View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Automatic search/replace

If there is only one piece of information to be inserted, you can get away
with an InputBox.

In place of your [insert product name here], I would insert a { DOCVARIABLE
varProductName } field in each location and then use the following code in
an autonew() macro in the template:

With ActiveDocument
.Variables("varProductName").Value = InputBox("Enter Product Name")
.Range.Fields.Update
End With

If there are multiple pieces of information, you could just repeat the above
two lines of code modified for each piece, but it is better to use a
UserForm:

See the article "How to create a Userform" at:

http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm


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

"Finnegan's Mom" wrote in message
...

Hello,

I'm unsure if I'm posting in the correct area--but I'm creating a
template with generic placeholders for information--right now, this
generic placeholder is in brackets, like this: [insert product name
here]. These are throughout the template. When a user creates a new
document based on that template, I'd like a dialog box to appear the
first time that person opens the new document, allowing the user to
type the product name, and then have all the [insert product name
here]'s replaced with what the user typed.

Is this possible?

TIA for your help.


--
Finnegan's MomPosted from - http://www.officehelp.in