TXTextControl.ObjectInsertAsChar Method

This method inserts a new OLE object or other control which is then handled like a single character in the text.

Syntax

TXTextControl.ObjectInsertAsChar ObjectType, FileName, TextPos, ScaleX, ScaleY, ImageDisplayMode, ImageSaveMode [,KindOfObject]
Parameter Description
ObjectType

Specifies the type of object. It can be one of the following identifiers:


Value Description
1 - OLE object Inserts an OLE object. The type of object can be selected with the system embedded OLE Insert dialog box.
2 - OLE object (programmatic identifier) Creates a newly created OLE object. In this case, the FileName parameter must specify a string which is the programmatic identifier of the OLE object to insert.The programmatic identifier is stored under the ProgID key in the registration database.
3 - OLE object (embedded) Inserts a newly created embedded OLE object from a file. In this case, the FileName parameter must specify a valid filename.
4 - OLE object (linked) Inserts a newly created linked OLE object from a file. In this case, the FileName parameter must specify a valid filename.
Otherwise Specifies a handle to a control that can be obtained with a control's hWnd property. In this case the FileName parameter must be set to zero.
FileName

The meaning of this parameter depends on the object that is to be inserted. See the description of the ObjectType parameter. This parameter must be zero if the ObjectType parameter specifies a handle to a control.

TextPos

Specifies the text position where to insert the object. If TextPos is -1, the object is inserted at the current input position.

ScaleX

Specifies a horizontal scaling factor as a percentage.

ScaleY

Specifies a vertical scaling factor as a percentage.

ImageDisplayMode

This parameter is obsolete and must be set to zero.

ImageSaveMode

This parameter is obsolete and must be set to zero.

KindOfObject

Optional. Specifies an identifier for controls that are not OLE objects. If a document is loaded which contains such controls, an ObjectGethWnd event occurs for each control to give an application the opportunity of recreating these controls. This parameter can be used to handle groups of different control types, like buttons or checkboxes.

Return Value

The method returns the object's identifier when an object could be inserted. Otherwise it returns zero. The object's identifier can also be obtained with the ObjectCurrent property.

Data Types

ObjectType:    Handle
FileName:    String
TextPos:    Long
ScaleX:    Integer
ScaleY:    Integer
ImageDisplayMode:    Integer
ImageSaveMode:    Integer
KindOfObject:    Integer
Return value:    Integer

See Also