I created a multi-page form in MS Word 2010. I then drafted a short macro that inserts the date and time into the form and then moves the cursor to the first open field. I want to put a shortcut on my desktop that, when clicked, opens Word, opens the document and runs the short macro. How do I do that?
I was hoping to find the macro file and drag-and-drop a copy onto my desktop so that when I click it it would automatically open the document and run the set-up macro. I found the normal.dotm file but can’t access individual macros within it. Is there a way to place on my desktop a shortcut to a particular Word macro?
Thanks.
In the Visual Basic Editor you will see a ThisDocument module for your Word document.
If you use a Document_Open event macro in that module, the code will run as soon as the document is opened.
The code below presents a MsgBox whenever the document is opened:
Perhaps if you replace my instruction with your instructions, you’ll get what you want.
All you’ll need is a shortcut to the document itself on your desktop.
Click Here Before Posting Data or VBA Code —> How To Post Data or Code.