Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

losing the value of a form field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rub - 28 Sep 2006 16:33 GMT
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?
zkid - 03 Oct 2006 02:46 GMT
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.

> I have a document that prints our several paragraphs including a form
> field which is populated after a calculation is made.
[quoted text clipped - 26 lines]
> except for the last time.  In otherwords aparter the first printout the
> form field went blank.  Any ideas why?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.