Syntax
ConvertObject [.IconNumber = number] [, .ActivateAs = number] [, .IconFilename = text] [, .Caption = text] [, .Class = text] [, .DisplayIcon = number]
Remarks
Converts the selected embedded object from one class to another, allows a different server application to edit the object, or changes how the object is displayed in the document. The arguments for the ConvertObject statement correspond to the options in the Convert dialog box (Object submenu, Edit menu).
Argument | Explanation |
.IconNumber | If .DisplayIcon is set to 1, a number corresponding to the icon you want to use in the program file specified by .IconFilename. Icons appear in the Change Icon dialog box (Object command, Insert menu): 0 (zero) corresponds to the first icon, 1 to the second icon, and so on. If omitted, the first (default) icon is used. On the Macintosh, icons for embedded objects cannot be changed; this argument is ignored. |
.ActivateAs | Specifies whether Word converts or sets the server application for the selected object: 0 (zero) Converts the selected object to the object type specified by .Class. 1 Uses the server application specified by .Class to edit the object. Note that this setting applies to all objects of the selected type and that Word uses the specified server application when inserting objects of the selected type. |
.IconFilename | If .DisplayIcon is set to 1, the path and filename of the program file in which the icon to be displayed is stored. On the Macintosh, icons for embedded objects cannot be changed; this argument is ignored. |
.Caption | If .DisplayIcon is set to 1, the caption of the icon to be displayed; if omitted, Word inserts the name of the object. |
.Class | A class name specifying the object type to convert to or the server application for editing the object, depending on the setting for .ActivateAs. The class name for a Word document is Word.Document.6 and a Word picture is Word.Picture.6. To look up other class names, insert an object of the type to convert to in a document and view the field codes; the class name of the object follows the word "EMBED." |
.DisplayIcon | Specifies whether or not to display the object as an icon: 0 (zero) or omitted Object is not displayed as an icon. 1 Object is displayed as an icon. |
Example
This Windows example changes the display of the selected embedded object to an icon stored in PROGMAN.EXE.
ConvertObject .IconNumber = 28, .IconFilename = "PROGMAN.EXE", \ .Caption = "Caption Text", .DisplayIcon = 1
See Also
InsertObject