Global variables in Word VBA and other questions

someboddy

Registered User.
Local time
Today, 17:52
Joined
Aug 27, 2009
Messages
28
1) Is there a way to create a global variable in VBA? I mean a variable that I can use no matter which document is open?

2) How can I create a text box in Word using VBA? I figured I need to do it with the CreateTextBox function, but how can I set the properties of the text box, and how can I finish the drawing and add text to it?

3) How can I search stuff inside text boxes? The find object of ActiveDocument.Content won't find things that are inside text boxes...

4) Is there a way to change the name of the custom button used to call functions and macros? It's kind of annoying to have the full object-path name displayed in a toolbar...

Thanks in advance!
 
1) Is there a way to create a global variable in VBA? I mean a variable that I can use no matter which document is open?
Any changes made to the normal.dot document will affect all new documents as this is the basic template opened whenever you select a new document in word.

2) How can I create a text box in Word using VBA? I figured I need to do it with the CreateTextBox function, but how can I set the properties of the text box, and how can I finish the drawing and add text to it?
Have you tried manually creating a text box and looking at the code behind it? This is one of the easiest ways to learn these things.

4) Is there a way to change the name of the custom button used to call functions and macros? It's kind of annoying to have the full object-path name displayed in a toolbar...
Again, creating your macro in the normal.dot should deal with this.

3) How can I search stuff inside text boxes? The find object of ActiveDocument.Content won't find things that are inside text boxes...

Sorry, off the top of my head can't help you with this one.
 
3) How can I search stuff inside text boxes? The find object of ActiveDocument.Content won't find things that are inside text boxes...

Thanks in advance!

I had to put stuff into a footer once (a real nusance). Probably along the same lines. I had to go through the objects contained in the word document, then drill down to find the appropriate container.

Lots of luck.
 

Users who are viewing this thread

Back
Top Bottom