Need to Add reference fields to a blank document

P

PiaD

I have a template with the following hidden reference field.

{ ASK MyField \* MergeFormat}

I use a {REF MyField \*MergeFormat} statement within my document to pull the
data where it needs to go. I have a macro that Selects ALL and then saves
all reference fields as regular text before the document is distributed
online. However, I would like to restore the ASK statements at the top of
the document in case further edits are needed.

So, what I would like to know is how to create a macro that automatically
inserts the ASK statement at the beginning of a document.

Thanks so much for any guidance with Word 2000 fields!!!
 
D

Doug Robbins - Word MVP

If you use the following code, in place of what you are now using, it will
only unlink the Ref fields.

Dim afield As Field
For Each afield In ActiveDocument.Fields
If afield.Type = wdFieldRef Then
afield.Unlink
End If
Next afield

Note, it may be better to Lock them rather than to unlink them as then if
you enter some new data into the Ask field, you could unlock the Ref fields
and have them update if required.

--
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
 

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