I'm fixing multiple documents by running multiple codes which right now I linked together with a Call. This works fine, but there are other pieces of the code I would like to hand select and run.
So my method now, open the VBE and manually run the VBA procedure I chose. I sometime might even use the Alt + F8, select, and run. I've also occasionally used a customized toolbar, but that's usually built in specifically to one document, not the document I'm trying to cleanup.
Looking for some ideas about how I could attack this. Is there anyway to import a ribbon or an add-in so I have all of the VBA procedures in the word document itself and can now point and click? I hope that makes sense.
Method to run vba code
-
- Administrator
- Posts: 78595
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Method to run vba code
You could store all macros in one document, and save that as a macro-enabled template (.dotm) in Word's startup folder (by default C:\Users\<username>\AppData\Roaming\Microsoft\Word\STARTUP). The template will then automatically be loaded as an add-in, so that the macros are always available.
You could create custom Quick Access Toolbar buttons for selected macros, or create a userform in the template with command buttons that run macros.
You could create custom Quick Access Toolbar buttons for selected macros, or create a userform in the template with command buttons that run macros.
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 91
- Joined: 02 Sep 2018, 23:12
Re: Method to run vba code
Sorry for the delay. I can't log in from work.
Thank you very much. I went with the macro-enabled template (.dotm) in Word's startup folder and then built a user form. Now to add all those macros to the form.
Thank you very much. I went with the macro-enabled template (.dotm) in Word's startup folder and then built a user form. Now to add all those macros to the form.
-
- StarLounger
- Posts: 91
- Joined: 02 Sep 2018, 23:12
Re: Method to run vba code
Hi Hans,
With your help so far, I have been able to capture some routine macros I need to run to clean up my documents. Curios, do you know of a place to go to find a collection of various other VBA routines that might be useful in cleaning up a word document? I know that's open ended, but anything to look over as a reference would be great.
With your help so far, I have been able to capture some routine macros I need to run to clean up my documents. Curios, do you know of a place to go to find a collection of various other VBA routines that might be useful in cleaning up a word document? I know that's open ended, but anything to look over as a reference would be great.
-
- Administrator
- Posts: 78595
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Method to run vba code
I don't, but let's see if others will have suggestions for you.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 628
- Joined: 10 Jan 2016, 15:56
- Location: Madison, Wisconsin
-
- StarLounger
- Posts: 91
- Joined: 02 Sep 2018, 23:12
Re: Method to run vba code
Thank you Charles
-
- 5StarLounger
- Posts: 628
- Joined: 10 Jan 2016, 15:56
- Location: Madison, Wisconsin
Re: Method to run vba code
You are welcome.
Attorney Charles Kenyon
Templates in Microsoft Word
Modifying the QAT
The Importance of Styles in Microsoft Word
Templates in Microsoft Word
Modifying the QAT
The Importance of Styles in Microsoft Word