Fields Used

T

Tywardreath

Hi

I have a shared database that is really large. Several people have created
mail merge documents only using a few of the database's fields. Is there a
way I can extract a list from Word of the mail merge fields used within a
document? If that is possible, is there a way to automate this process as
there are a LOT of mail merge files to go through (over 3,000).

Cheers, Tywardreath.
 
G

Greg Maxey

You might use a macro something like the following that will display a list
in the VBA immediate window:

Sub ListMergeFieldsInDoc()
Dim oFld As Field

For Each oFld In ActiveDocument.Fields
If oFld.Type = wdFieldMergeField Then
Debug.Print oFld.Code.Text
End If
Next
End Sub
 

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