losing the value of a form field

R

rub

I have a document that prints our several paragraphs including a form
field which is populated after a calculation is made.

All works fine. When I go to print the form field is blank.

I went to test where the form field went blank after having the correct
number in it.

My code is as follows:

Dim strMsgbox As String
strMsgbox = ActiveDocument.FormFields("text1").Range.Text
MsgBox strMsgbox
Dim intResponse As Integer
intResponse = MsgBox("Do you want to print the lease", vbYesNo)
strMsgbox = ActiveDocument.FormFields("text1").Range.Text
MsgBox strMsgbox
If intResponse = 6 Then
strMsgbox = ActiveDocument.FormFields("text1").Range.Text
MsgBox strMsgbox
ActiveDocument.PrintOut
strMsgbox = ActiveDocument.FormFields("text1").Range.Text
MsgBox strMsgbox
ActiveDocument.PrintOut
ActiveDocument.Protect Type:=wdAllowOnlyReading, NoReset:=True
End If

everytime the message box came up it had the correct number in it
except for the last time. In otherwords aparter the first printout the
form field went blank. Any ideas why?
 
Z

zkid

Is the setting under Tools, Options, Print tab set to Update fields (at
printing)? If so, that could be your problem. If not, your protection type
seems a bit fishy.
 

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