Word Template

J

jlo

I created a template that prompts the user using Ask field codes as well as
Fill In field codes.

The problem I am having now is I need to ask a Yes or No question. If yes,
I need to include a paragraph of verbiage as well as adding another page to
the end of the document. I researched the If statements, Include Text field
code and Cross References. I do not know VB too well. The user did not want
a user form. I am on the right track or does anyone have a better idea.

Thanks!
 
D

Doug Robbins - Word MVP

The User is wrong. A userform would be a much better method.

However, if you have an autotext entry saved as yes, you could use the
following with a dropdown type formfield as used in a protected document:

' Macro2 Macro

' Macro created 15-11-97 by Doug Robbins to add the address corresponding to
a drop down name

'

Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown

Company = myDrop.ListEntries(myDrop.Value).Name

Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Company).Value

ActiveDocument.FormFields("Text1").Result = Address

You may also be able to do it with a fillin or ask field inside an
If...then...Else field construction, but I have not tried as I would use a
userform instead.


--
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
 
J

jlo

Thank you.

Doug Robbins - Word MVP said:
The User is wrong. A userform would be a much better method.

However, if you have an autotext entry saved as yes, you could use the
following with a dropdown type formfield as used in a protected document:

' Macro2 Macro

' Macro created 15-11-97 by Doug Robbins to add the address corresponding to
a drop down name

'

Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown

Company = myDrop.ListEntries(myDrop.Value).Name

Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Company).Value

ActiveDocument.FormFields("Text1").Result = Address

You may also be able to do it with a fillin or ask field inside an
If...then...Else field construction, but I have not tried as I would use a
userform instead.


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

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