FILL IN FIELDS

J

JJ

I have a macro which creates a document based on a template. It prompts
at all the fill in fields. Can I de-activate the fill in fields until
later as I have written a counter macro which searches for each fill in
field in the document, prompts you for an answer (I do this so that you
can see exactly where you are in the document), adds the answer to the
fill in field, clears that specific field and moves onto the next one.
Problem comes in that when you add the document it promps for the fill
in fields which I don't want. How can I disable it. At the moment my
macro looks like this:

Sub Test()
Documents.Add Template:="c:\templates\Articles Employment
Contract.dot", NewTemplate:=False, DocumentType:=0

With ActiveDocument.Variables
For i = .Count To 1 Step -1
.Item(i).Delete
Next i
End With
Call counter
End Sub

Can I when I say documents.add tell it not to prompt at the fill in
fields? Can I lock the fields not to update as suggested by someone
else. If yes, how do I lock the fields?
 
J

JJ

Found my own solution as follows:
Documents.Add Template:="c:\templates\Articles Employment
Contract.dot", NewTemplate:=False, DocumentType:=0

With ActiveDocument.Variables
For i = .Count To 1 Step -1
.Item(i).Delete
Next i
End With

Selection.WholeStory
Selection.Fields.Locked = False
Selection.MoveUp Unit:=wdLine, Count:=1

Call ClearProcedure
Selection.GoTo What:=wdGoToBookmark, Name:="BOOKMARK"
 

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