Can't find locked fields

R

Ron Ford

I am trying to determine which merge fields are locked,
as I get a 'Word found locked fields during the update.'
which stops my attempt at having a merge document print
automatically.

The following code in my macro produces nDataFields = 81,
nFieldNames = 81, but nFieldNames = 0.

Since only the Fields(i) has a Locked property, I am
unable to find which fields are locked (I have pressed
Ctrl+Shift+F11 on every merge field in my .dot file but
the error message still occurs).

Any help will be much appreciated.

Macro Code:

Dim mdoc As MailMerge
Dim nDataFields, nFieldNames, nFields As Integer

Documents.Open "C:\working\forms\test.dot"
Set mdoc = ActiveDocument.MailMerge
nDataFields = mdoc.DataSource.DataFields.Count
nFieldNames = mdoc.DataSource.FieldNames.Count
nFields = mdoc.Fields.Count

As an aside, there are only 80 merge fields (not 81) in
my document. They are a mixture of MergeFields and
If..Then..Else fields.
Using Word 2000 on XP.
 

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