deleting form fields

P

philr

I want to create a template form that after the document is created and
saved, the user can Open the saved document, run a "macro??" and delete only
specific fields in the form in one pass.

The original forms has ~200 fields. We want to be able to reOpen the
previously saved document, keep ~50 fields from the original and blank (or
Delete) the remaining ~150 fields with a single command. The feilds are
always the same.

What is the best way to solve this? I thought of building a macro but when
you run the macro on the filled in form, it takes a long time to remove the
fields in the document when the author is ready to type. VBA seemed like a
better option but I'm not as familiar.
Using Word 2003 on XP.

Thanks,
philr
 
D

Doug Robbins - Word MVP

Word macros use VBA so your belief that VBA might be a better option is sort
of meaningless. No doubt however, the code that you have may be able to be
improved upon however so it would be a good idea to post it into a message.

Best if you explain what it is necessary to be able to do with the 50
formfields that you want to retain.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
P

philr

Thanks Doug,

We have a 7 page paper form with quite a few blank spaces for handwritten
responses to keep track of patients. The ~50 spaces are basically
demographics, the next ~150 are often visit related. (We'll eventually move
to an EMR system, but we're not there yet.)

Our short term goal is to minimize some of the load by keeping the first 50
spaces intact for each patient. Instead of saying File | New each time we
need to fill in the form, we want to File |Open and look for the patients
previous form. Once Opened we would like to run a macro deleting the last 150
"spaces", and we saved again under a different name and add the new
information in the now blank spaces.

We know a relational db might be a better tool for this but for a number of
complicated reasons, this will have to do.

Separately, I have a lot of trouble getting into this forum and either
making a new thread, like I did with this yesterday, or replying after
signing in. I have to try multiple times. Do I need to install Silverlight to
make this work better?

Thanks,
philr
 
D

Doug Robbins - Word MVP

I would separate the first ~50 formfields from those that you want to re-use
by a section break and then use a macro with the following code to remove
the data from each of those formfields

Dim aff As FormField
For Each aff In ActiveDocument.Sections(2).Range.FormFields
aff.Result = ""
Next aff


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

Sorry, I did not respond to the separate item about accessing the
Newsgroups. I would suggest that you use Outlook Express for the purpose.
The following are detailed instructions for doing so:

1.1. Connect to a newsgroup server using Outlook Express
Open Outlook Express and follow these steps:

1.. On the Tools menu, click Accounts.
2.. In the Internet Account dialog box, click Add, and then click News.
The Internet Connection Wizard starts. Follow these steps in the wizard:
1.. On the first screen, in the Display name box, type the name that
other users will see when you post a message to the newsgroup, and then
click Next.
2.. On the second screen, type your full e-mail address in the E-mail
address box, and then click Next.
3.. On the third screen, in the News (NNTP) Server box, type the name of
your news server. To subscribe to the newsgroups hosted on Microsoft's
servers, type msnews.microsoft.com. If you don't know the name of your news
server, contact your Internet provider.
4.. If necessary, select the My news server requires me to log on check
box, and then click Next. If you don't know whether your server requires you
to log on, contact your Internet provider. The Microsoft server does not
require a user name and password.
5.. On the last screen, click Finish.
3.. Click Close, and then click Yes when asked if you want to download
newsgroups from the account you just created. The Newsgroup Subscriptions
dialog box appears.
4.. Select the newsgroups you want to use, click Subscribe, and then click
OK.

Note Most of Microsoft newsgroups use this naming convention:
microsoft.public.application_name.specific_area. For example: you could
subscribe to microsoft.public.office.dataanalyzer, or
microsoft.public.excel.programming. However, that isn't always the case.
Don't be afraid to browse the list of groups in order to find something that
you think will be useful.

5.. On the Tools menu, click Options, click the Read tab, and then clear
the Get 300 headers at a time check box.
6.. Click the Maintenance tab, clear the Delete new messages n days after
being downloaded check box, and then click OK.
Step 5 allows you to download and read all the newsgroup's postings when you
first subscribe. Step 6 allows you to read older messages.

1.2. Subscribe or unsubscribe to newsgroups
After you establish a connection to your newsgroup server, you add
newsgroups to your list by subscribing. You can subscribe or unsubscribe to
newsgroups at any time. Typically, you use the group name as a guide when
subscribing. For example, a name such as
microsoft.public.office.developer.outlook.forms would be a good place to
start if you need help writing a custom form for Outlook.

To subscribe

1.. Start Outlook Express.
2.. In the folder pane, click the name of your news server. For example,
if you established a connection to Microsoft's server, click
msnews.microsoft.com.
3.. In the main viewing pane, click Newsgroups.
4.. In the Newsgroup Subscriptions dialog box, select a newsgroup from the
list, and then click Subscribe.
5.. Repeat the previous step to subscribe to additional newsgroups, and
then click OK when you finish.
6.. In the main viewing pane, double-click the name of the new newsgroup.
If you only want to receive new messages since the last time you visited,
select the New messages only check box, and then double-click the newsgroup
name.

Note When you subscribe to a newsgroup for the first time, you receive
all the messages whether or not you select the New messages only check box.
To unsubscribe

a.. In the Outlook Express folder pane, right-click the newsgroup that you
want to stop using, and then click Unsubscribe on the shortcut menu.
Tips

a.. To reduce the number of items in the list of available newsgroups,
enter a phrase in the Display newsgroups which contain box. For instance,
you can enter an application name such as "publisher" or the name of a
discipline such as "programming." The list changes automatically when you
finish typing.
b.. Newsgroups in languages other than English are identified by their
names; for example, microsoft.public.fr.excel is a newsgroup for Microsoft
Excel users who speak French.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
G

Graham Mayor

The steps are also covered at http://www.gmayor.com/MSNews.htm however do
note the need to disguise your e-mail address or you will be inundated with
spam.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top