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 / February 2005

Tip: Looking for answers? Try searching our database.

Document Variable vs Bookmark

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Starbird - 06 Feb 2005 23:33 GMT
I have a template that I have used bookmarks in which work fine, but because
there is a possibility of the data needing to be changed (via userform) after
the original document is created, I am trying to use a document variable
instead.
The following works fine --
  ActiveDocument.Bookmarks("MyTest").Range.Text = oForm.txtMyTest.Text

However when I attempt the following, (I set a docvariable named MyTest in
the location where the bookmark previously existed) it fails to populate--
  ActiveDocument.Variables("MyTest").Value = oForm.txtMyTest.Text

What am I doing wrong?
Thanks in advance!

SRD
Jonathan West - 06 Feb 2005 23:50 GMT
>I have a template that I have used bookmarks in which work fine, but
>because
[quoted text clipped - 10 lines]
>
> What am I doing wrong?

You're not updating the docvariable field after you change the value of the
variable. Add this line after

ActiveDocument.Fields.Update

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Jezebel - 06 Feb 2005 23:55 GMT
You need to update fields. If all the fields are in the body of the document
you can simply use

ActiveDocument.Fields.Update

If the fields are in headers, footers or any other StoryRange you need to
update them separately.

>I have a template that I have used bookmarks in which work fine, but
>because
[quoted text clipped - 13 lines]
>
> SRD
Doug Robbins - 07 Feb 2005 00:22 GMT
Which can usually be done most easily by using

ActiveDocument.PrintPreview
ClosePrintPreview

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> You need to update fields. If all the fields are in the body of the
> document you can simply use
[quoted text clipped - 23 lines]
>>
>> SRD
Starbird - 07 Feb 2005 00:37 GMT
Thank You!

> You need to update fields. If all the fields are in the body of the document
> you can simply use
[quoted text clipped - 21 lines]
> >
> > SRD
 
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.