Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / November 2005

Tip: Looking for answers? Try searching our database.

Automatic search/replace

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Finnegan's Mom - 22 Nov 2005 22:32 GMT
Hello,

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

Is this possible?

TIA for your help
Doug Robbins - Word MVP - 23 Nov 2005 04:49 GMT
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

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

> Hello,
>
[quoted text clipped - 10 lines]
>
> TIA for your help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.