OLEFormat.ActivateAs method (Word)

Sets the Windows registry value that determines the default application used to activate the specified OLE object.

Syntax

expression. ActivateAs( _ClassType_ )

expression Required. A variable that represents an 'OLEFormat' object.

Parameters

Name Required/Optional Data type Description
ClassType Required String The name of the application in which an OLE object is opened. To see a list of object types that the OLE object can be activated as, click the object and then open the Convert dialog box. You can find the ClassType string by inserting an object as an inline shape and then viewing the field codes. The class type of the object follows either the word "EMBED" or the word "LINK."

Example

This example sets the first floating shape on the active document to open in Microsoft Excel, and then it activates the shape. For the example to work, this shape must be an OLE object that can be opened in Microsoft Excel.

With ActiveDocument.Shapes(1).OLEFormat 
 .ActivateAs ClassType:="Excel.Sheet" 
 .Activate 
End With

See also

OLEFormat Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.