View Single Post
Old 01-05-2003, 05:40 PM   #3
andrewas
Harper
 

Join Date: October 2, 2001
Location: Aberdeen, Scotland
Age: 43
Posts: 4,774
I dont suppose your up on Visual Basic programming? No? Then we do this the easy way.

I am terrible at remembering menu options, so these are taken from office XP. Earlier versions will require some experimentation.

Tools->record->new macro

Give it a name, set it to record in only the document your using. You can also set it to record in a template, in which case all documents created with that template will have the macro included.

Now you have to set a trigger for the macro. XP handles this differently from different versions, you get two buttons to select a trigger key or put a button on the toolbar. Both are pretty self explanatory. I dont have an earlier copy to hand to see how they do it, but its not that complicated.

Anyway, once you finish with that dialogue youll see a new tooldbar (with stop and pause buttons on it). Type text into your document, the macro will record every action and translate it to code for you. When your finished, hit the stop button.

Hit the trigger button/key you assigned, and the macro should put the text into your document. This is a good time to check for typos and suchlike.

You can edit the macro directly by going into tools->macros->macros. In this case your macro will probably look something like:

Sub Test()
Selection.TypeText Text:="testtesttest"
End Sub
__________________
[img]\"http://www.sighost.us/members/Zvijer/andrewas.gif\" alt=\" - \" />
andrewas is offline