I'm working on a document and want this to happen:
Document asks "Username?" using the ASK field.
If something is typed in, i want it to display Username: and then the
persons username, but if nothing is typed in the box, i want it not to show
anything, not even the "Username:" label. Word is seeming to have trouble
with the 'nothing' part of this. Here is what i've tried which hasnt seemed
to work:
{ ASK user "Username:" }
{ IF user = "" " " "Username:{user}" }
Any help will be much apreciated!
Doug Robbins - Word MVP - 09 Sep 2006 15:13 GMT
As you have posted to a VBA newsgroup, I would suggest that you use an
InputBox and insert a bookmark named user where you want the name to appear.
Dim User as String
User = InputBox("Enter your name.")
ActiveDocument.Bookmarks("user").Range.InsertBefore User

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> I'm working on a document and want this to happen:
> Document asks "Username?" using the ASK field.
[quoted text clipped - 10 lines]
>
> Any help will be much apreciated!
Graham Mayor - 09 Sep 2006 15:24 GMT
Word isn't having trouble! It's you that has the syntax wrong. Try
{ IF { User } = "Error!*" "" "Username : {user }" }
or
{ IF { User }<> "Error!*" "Username : {user }" }

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> I'm working on a document and want this to happen:
> Document asks "Username?" using the ASK field.
[quoted text clipped - 8 lines]
>
> Any help will be much apreciated!