DocumentBase.GetAutomationObject Method
Called by the Visual Studio Tools for Office runtime to get an object that can be used by VBA code in the document.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
Syntax
'Declaration
Protected Overridable Function GetAutomationObject As Object
protected virtual Object GetAutomationObject()
Return Value
Type: System.Object
An object in a document-level customization that can be used by VBA code in the document.
Remarks
Override this method to return an instance of a class that you have exposed to VBA code in the document. For more information, see Calling Code in Document-Level Customizations from VBA.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Office.Tools.Word Namespace
Other Resources
Calling Code in Document-Level Customizations from VBA
How to: Expose Code to VBA in a Visual Basic Project
How to: Expose Code to VBA in a Visual C# Project
Walkthrough: Calling Code from VBA in a Visual Basic Project