TextFieldSetTypeAndData

Description

Sets the type and type data of the text field in a RichTextEdit control.

Applies to

RichTextEdit controls

Syntax

rtename.TextFieldSetTypeAndData (integer id, string type, string typedata)

Argument

Description

rtename

The name of the RichTextEdit control in which you want to set the type and type data of the text field

id

The ID of the text field to be set

type

The type of the text field to be set. The following types are supported now (the strings are case-insensitive):

  • standard -- The standard text type to which the newly inserted text field is set by default. If type is standard, the typedata argument will be ignored.

  • externallink -- The external link that can link to the external document or URL. You can set the address of the external link by the typedata argument.

  • internallink -- The internal link that can link to a location within the current document. You can set the address of the internal link which is also the target name by the typedata argument.

typedata

A string specifying the type data of the text field.

  • If type is set to standard, the type data cannot be set in the text field and this argument will be ignored.

  • If type is set to externallink, the type data represents the address of the external link. (for example, https://www.appeon.com)

  • If type is set to internallink, the type data represents the name of an internal target.


Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs. Returns -2 if the specified type is not supported.

If any argument's value is null, returns null.

Examples

This example inserts a text field (with a text value "Test") and sets the type and typedata of the text field in the RichTextEdit rte_1:

integer li_rtn,li_id

li_id =  rte_1.TextFieldInsert("Test")
li_rtn = rte_1.TextFieldSetTypeAndData (li_id,"externallink","https://www.appeon.com/")
MessageBox("TextFieldSetTypeAndData",string(li_rtn))

See also

TextFieldGetType

TextFieldGetTypeData