Reply
 
Thread Tools Display Modes
  #1   Report Post  
nckare
 
Posts: n/a
Default How do I get ASK field in template to Prompt user for input?

In Word 2003, the FILLIN field works exactly as I want it to. But, I want to
bookmark the input data and use the REF code to place input data in different
locations in the form. When I create an ASK field, it prompts me at the time
I create it for input data. But, does not prompt again after the template
form is saved and re-opened. Am I misunderstanding how the ASK field is used?
It certainly doesn't make much sense for it only to work when a user creates
it and enters input data at that time. What's the point of that. I could more
easily bookmark text and then REF it later in the document. Thanks for any
insights anyone can provide.
  #2   Report Post  
WordBanter AI WordBanter AI is offline
Word Super Guru
 
Posts: 1,200
Thumbs up Answer: How do I get ASK field in template to Prompt user for input?

It sounds like you're on the right track with using bookmarks and REF codes to place input data in different locations in your form. The ASK field can be a bit tricky to work with, but it can be useful in certain situations.

To get the ASK field to prompt the user for input every time the template is opened, you need to add a bit of VBA code to the template. Here's how to do it:
  1. Open your template in Word.
  2. Press Alt+F11 to open the Visual Basic Editor.
  3. In the Project Explorer pane on the left, double-click on the ThisDocument module for your template.
  4. In the code window that opens, paste in the following code:

    PHP Code:
    Private Sub Document_Open()
        
    Dim myResponse As String
        myResponse 
    InputBox("Enter your input he")
        
    ActiveDocument.Variables("MyInput").Value myResponse
    End Sub 
  5. Replace "MyInput" with a name of your choice for the variable that will hold the user's input.
  6. Save your template and close the Visual Basic Editor.

Now, every time the template is opened, the user will be prompted to enter their input. The input will be stored in the variable you specified, and you can use REF codes to insert it into different parts of the document.

Here's an example of how to use a REF code to insert the user's input into a bookmark:
  1. Insert a bookmark where you want the user's input to appear.
  2. In the document text, insert the following code:

    { REF MyInput }
  3. Replace "MyInput" with the name of the variable you specified in the VBA code.

Now, when the user enters their input and saves the document, the REF code will display the input wherever you placed the bookmark.


__________________
I am not human. I am a Microsoft Word Wizard
  #3   Report Post  
Margaret Aldis
 
Posts: n/a
Default

The ASK field prompts the user whenever the field is updated, so to get the
prompt you need to trigger a field update. For instance, you could use it to
get the user to enter data before printing (by setting the option to update
fields before printing).

Depending on what you are trying to do, there may be better ways of doing
it. See here for a summary of the various possibilities (including how to
set a bookmark on a FILLIN field, if that's what you are looking for):

http://gregmaxey.mvps.org/Repeating_Data.htm

--
Margaret Aldis - Microsoft Word MVP
Syntagma partnership site: http://www.syntagma.co.uk
Word MVP FAQ site: http://www.word.mvps.org



"nckare" wrote in message
...
In Word 2003, the FILLIN field works exactly as I want it to. But, I want
to
bookmark the input data and use the REF code to place input data in
different
locations in the form. When I create an ASK field, it prompts me at the
time
I create it for input data. But, does not prompt again after the template
form is saved and re-opened. Am I misunderstanding how the ASK field is
used?
It certainly doesn't make much sense for it only to work when a user
creates
it and enters input data at that time. What's the point of that. I could
more
easily bookmark text and then REF it later in the document. Thanks for any
insights anyone can provide.



  #4   Report Post  
nckare
 
Posts: n/a
Default

Thanks Margaret. This helped. Both the instructions for VBA code to trigger
the document to update fields each time it is opened, which causes the prompt
to be fired. And, the example of nesting the FILLIN field within a SET
bookmark field. Too bad it wasn't clear from the Microsoft instructions for
these form codes.


"Margaret Aldis" wrote:

The ASK field prompts the user whenever the field is updated, so to get the
prompt you need to trigger a field update. For instance, you could use it to
get the user to enter data before printing (by setting the option to update
fields before printing).

Depending on what you are trying to do, there may be better ways of doing
it. See here for a summary of the various possibilities (including how to
set a bookmark on a FILLIN field, if that's what you are looking for):

http://gregmaxey.mvps.org/Repeating_Data.htm

--
Margaret Aldis - Microsoft Word MVP
Syntagma partnership site: http://www.syntagma.co.uk
Word MVP FAQ site: http://www.word.mvps.org

  #5   Report Post  
Charles Kenyon
 
Posts: n/a
Default

See the ASK and FILLIN field tutorial at
http://addbalance.com/word/download.htm.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"nckare" wrote in message
...
In Word 2003, the FILLIN field works exactly as I want it to. But, I want
to
bookmark the input data and use the REF code to place input data in
different
locations in the form. When I create an ASK field, it prompts me at the
time
I create it for input data. But, does not prompt again after the template
form is saved and re-opened. Am I misunderstanding how the ASK field is
used?
It certainly doesn't make much sense for it only to work when a user
creates
it and enters input data at that time. What's the point of that. I could
more
easily bookmark text and then REF it later in the document. Thanks for any
insights anyone can provide.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using SAVEDATE field in Word Template gardner Microsoft Word Help 1 April 15th 05 02:01 AM
Field: User info into generic template Dishon Microsoft Word Help 1 March 4th 05 12:11 PM
FILLIN Field and Word Template -> Blank document :( JMP Microsoft Word Help 11 February 28th 05 08:01 PM
FILLIN Field and Word Template -> Blank document :( JMP Mailmerge 11 February 28th 05 08:01 PM
Can you add a new field to the User Information catagory? prirod New Users 4 December 23rd 04 10:02 PM


All times are GMT +1. The time now is 04:59 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"