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
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]
>
>.