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 / Mailmerge and Fax / October 2003

Tip: Looking for answers? Try searching our database.

Compare Value of a Bookmark

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom - 17 Oct 2003 19:45 GMT
I am creating some templates.  Normally I would use a
FILLIN Field to get information from the user however I
want to excecute certain lines of code based on the
answer.  So I am using ASK and storing the info in a
bookmark.  However I don't know how to compare the value
of a bookmark in an If statement.

Selection.Fields.Add Range:=Selection.Range,
       Type:=wdFieldEmpty,
       Text:= _ "ASK  someBookmark ""Prompt:"" ",
       PreserveFormatting:=True

If someBookmark = "TEST" Then (This does not work)
End if

Any suggestions would be greatly appreciated.

Thanks,

Tom
Doug Robbins - Word MVP - 19 Oct 2003 03:25 GMT
Hi Tom,

Use a { REF } field to get the text of the bookmark.

However, I think you would really be better off to use a userform.  See the
article "How to create a Userform" at:

http://www.mvps.org/word/FAQs/Userforms/CreateAUserForm.htm

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested.  Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
> I am creating some templates.  Normally I would use a
> FILLIN Field to get information from the user however I
[quoted text clipped - 16 lines]
>
> Tom
Tom - 20 Oct 2003 15:55 GMT
Thanks for the help.  The { REF } works in the word file
but not in the macro.  I tried if { REF bookmarkName} =
but it didn't like the "{".  I also tried it without the
brackets then it expected a "then" instead of
bookmarkName.  

However the Userform works great.  I had ruled that out
in my head awhile ago without even trying it.  But it
does work fine I don't know what I was thinking.

Thanks again,

Tom

>-----Original Message-----
>Hi Tom,
[quoted text clipped - 34 lines]
>
>.
 
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.