How To Run a Word Macro While Editing a Word Object in VB (116040)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
- Microsoft Word for Windows 6.0
This article was previously published under Q116040 SUMMARY
This article gives three examples to show you how to run a Word macro while
editing a Word object in Visual Basic. You cannot run a Word macro directly
by using the ToolsMacro command because you cannot run a Word macro while a
Word object is activated in another application. When you attempt to run
the Word ToolsMacro command, you are doing the same thing as choosing
Macro... from the Word Tools menu. When acting as an in-place OLE server,
Word enables only those menu items that apply to the object that is being
edited in the OLE container application; the Macro... menu item is not one
of them.
For example, if you embed a Word object in a Microsoft Publisher version
2.0 publication, Word knows it wouldn't make sense to choose Save from the
File menu in Word to save the object. It is the container application's
(Publisher's) responsibility to save its own documents and all the objects
in them. In fact, when you choose Save from the File menu in Publisher
while editing a Word object, Publisher saves the object because OLE objects
cannot own the File menu. Therefore, menu items such as ToolsMacro are
disabled.
REFERENCES
For more information on this topic, please see the following article in the
Microsoft Knowledge Base:
106282 Word Items Available When Word 6.0 Is in Server Mode
Modification Type: | Minor | Last Reviewed: | 3/9/2005 |
---|
Keywords: | kbhowto kbNoUpdate KB116040 kbAudDeveloper |
---|
|