how can I insert "RBS" or "NS" in my document more than ten times.

K

Kezza

I have a document template the text is the same throughout apart from
sometimes in various places in the document a bank used which is either The
Royal Bank of Scotland or National Savings. I wanted to set up the template
so when you load it up it asks you "RBS or NS" and when you have replied with
either "RBS" or "NS" is then goes and inserts the answer into the large
document in the places I have indicated. How can I do this?? Any assistance
would be greatly appreciated.
 
E

Ed

I would probably do an AutoOpen macro in the template. If you want to get
fancy, create a UserForm and use the buttons to set which one; otherwise you
can use a simple Message Box - "Click Yes for RBS and No for NS". Take the
response and use that to determine which text string to use. How are you
"indicating" the places to put in this text? Are you using bookmarks? Find
and Replace? That will determine the rest of your code. I think easiest
would be bookmarks.

There's probably a smoother, more elegant way to do this, but this is how I
would do it.
Ed
 
K

Kezza

I just cant grasp it. I havent a clue about bookmarks etc. etc. so I will
just have to figure it out myself. Thank you for your input anyway Ed x
 
G

Greg

A bookmark is nothing more than a marked spot in the document. Our
brain can easily find a dog eared page in a book. Word easily finds a
bookmark in a document. Colored PostIt stickies expanded our brains
capacity to find specfic text. Named bookmarks help Word along just as
well. If you are going to figure it out yourself then you will likely
need to apply some of the programs features.

You can easily achieve your goals with a FILLIN or ASK field
See the UserPrompts section and other "helpful" links at:

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

Kezza

I just want to say thank you for your input Ed and Greg. I love to learn new
things and this whole programming within word is something I want to get to
grips with. Without both your help I'd still be chasing my tail, so thanks
:eek:)
 
E

Ed

Two things that have helped me most are the Help files, both in the Word
screen and in the VBE screen, and the macro recorder. While you have Word
open, press F1 and look up Bookmarks in the Help files. Activate the macro
recorder and record the actions of creating a new bookmark. Then press
Alt+F11 to open the VB Editor and look at the macro you just recorded. For
more information, click on Bookmark in the macro code and press F1.

If all you need is to insert one text string or another in several places,
always the same places and always the same string, then I'd say create
bookmarks in the places you need the text and use a simple "this or that"
macro to make fill bookmark with your text.

Reading that seems daunting; trying to do it near impossible. But after
doing it once, it's amazing how simple it can be.

Ed
 

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