Bobinnc
01-09-2007, 08:39 PM
I wrote an AutoExec macro that runs everytime Word is opened. However, when Word is invoked from another application, the AutoExec macro does not run. I suspect that this is a shell of Word. How can I make the AutoExec macro run automatically on opening an embedded Word Document when Word is not already opened?
Here is a simple example of my problem:
Initial Set-up:
1. Open Word
2. Add the following AutoExec macro to the Normal module:
Sub AutoExec()
MsgBox "Hello"
End Sub
3. Save Normal
4. Close Word
Test to Confirm AutoExec Macro:
1. Open Word
2. Confirm that the Message Box is displayed and okay it.
3. Close Word
Test to Confirm AutoExec Macro:
1. Open WordPad (other applications react in a similar fashion)
2. Type a few words and hit <enter>
3. Choose Menu Item "Insert", "Object..."
4. Pick "Create New", "Microsoft Word Document", check "Display as Icon" and press OK.
5. Microsoft Word Opens to a blank document, titled "Document in Document"
6. Note that the Message Box did not display.
7. Close Word
8. Close WordPad
Please lend your brains to help me solve this puzzle. Thanks.
BTW: I am using Word 2002 and running Windows XP
Here is a simple example of my problem:
Initial Set-up:
1. Open Word
2. Add the following AutoExec macro to the Normal module:
Sub AutoExec()
MsgBox "Hello"
End Sub
3. Save Normal
4. Close Word
Test to Confirm AutoExec Macro:
1. Open Word
2. Confirm that the Message Box is displayed and okay it.
3. Close Word
Test to Confirm AutoExec Macro:
1. Open WordPad (other applications react in a similar fashion)
2. Type a few words and hit <enter>
3. Choose Menu Item "Insert", "Object..."
4. Pick "Create New", "Microsoft Word Document", check "Display as Icon" and press OK.
5. Microsoft Word Opens to a blank document, titled "Document in Document"
6. Note that the Message Box did not display.
7. Close Word
8. Close WordPad
Please lend your brains to help me solve this puzzle. Thanks.
BTW: I am using Word 2002 and running Windows XP