Last week, several customers called our support department, asking how to change the FieldTypeData property of an existing field using TX Text Control ActiveX.

The FieldTypeData property sets or returns the data that belongs to a marked text field of a special type, for example an external hyperlink. In this case, the property contains the URL of the hyperlink.

It is not possible to set the FieldTypeData twice, if the FieldType has not been specified again. So, the required code to change the FieldTypeData is as follows:

TXTextControl1.FieldInsert "Test"
Dim FieldId As Integer
FieldId = TXTextControl1.FieldCurrent

TXTextControl1.FieldType(FieldId) = txFieldExternalLink
TXTextControl1.FieldTypeData(FieldId) = "http://www.google.com"
MsgBox TXTextControl1.FieldTypeData(FieldId)

TXTextControl1.FieldType(FieldId) = txFieldExternalLink
TXTextControl1.FieldTypeData(FieldId) = ""
MsgBox TXTextControl1.FieldTypeData(FieldId)