Help with ASK field, please?

E

Ed from AZ

I want to be prompted for a value to be inserted into a bookmark every
time I open a certain document. I inserted a bookmark using the
Insert >> Bookmark menu. Then I used Insert >> Field to insert an ASK
field. The field code looks like:
{ ASK Qty "How many are left?"}

The input box fires and I input my value, but the bookmark never
populates. What might be wrong?

Ed
 
P

Peter Jamieson

In Word, you can set the value of a bookmark in a number of ways, including:
a. you insert some text (and perhaps other stuff), select it, then use
Insert|Bookmark to bookmark that piece of text
b. you use a { SET mybookmark "myvalue" } or { ASK mybookmark "myvalue?"}
field to assign a value to a bookmark

To display the value of a bookmark, however you created it, you can use a
{ REF mybookmark } field.

However, what /doesn't happen in Word is that if you bookmark a piece of
text, then use a SET or ASK field to assign a new value to the bookmark, the
text that you previously bookmarked changes to reflect the new value (in
fact, when Word executes a SET or ASK, the /location/ of the bookmark
changes as well, to be a point location at the point where the SET or ASK
field was entered.

This is probably more than you want to know, but...)

Another thing to be aware of is that a REF field will display the value of
the bookmark at the tim the REF field is executed. So if you have

a: <a piece of text that says valuea and is bookmarked "bma">
b: { REF bma }
c:
d: { REF bma }

and select the document and press F9 to re-execute all the fields, you would
see

a: valuea
b: valuea
c:
d: valuea

If you then change

c:

to be

c: { SET bma valueb }

then select the document and press F9 to re-execute all the field codes, you
should see
a: valuea
b: valuea
c:
d: valueb

because until the SET is exectued, the value of { REF bma } is still valuea

then select the document again and press F9 and you should see
a: valuea
b: valueb
c:
d: valueb

Peter Jamieson
 
P

Peter Jamieson

BTW, if you're using Word 2007, you probably ought to look at using COntent
Controls for this kind of stuff.

Peter Jamieson
 
E

Ed from AZ

Thank you, Peter, for lots of info.
Still very good to know.
Oops - no, I'm using Word 2003.

Is there a way to accomplish my original task using fields?Or would I have to resort to a macro?

Ed
 
P

Peter Jamieson

Is there a way to accomplish my original task using fields?
Or would I have to resort to a macro?

If you put your ASK right at the top of the document and insert your text
using a REF, then execute the fields once and save the template, I think you
should be OK. In other words, don't try to set the initial value of the
bookmark by typing the text then using Insert|Bookmark - just use a REF
field to insert the value.
Or would I have to resort to a macro?

I hope not ...

Peter Jamieson
 
M

macropod

Hi Ed,

If you only want the result of the prompt to appear in one place, you could use a FILLIN filed at that location, instead of an
ASK/REF combination. No bookmark is required in this case.

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top