Description
Inserts an existing text at the specified position in the article.
Available in Ted and Fred.
Syntax
object.InsTxt nIdx, nTxtId, nReferenceBasketId, strReferenceDlgPars |
object
Required. Object name. Returned by Ted.GetActiveArticle.
nIdx
Insert position of the text, ranging from 0 = before the first element in the article to NTxts = after the last element in the article.
If it is not possible to insert elements of the text's type at this position the function fails with an error message.
If this parameter is negative the user is prompted to select the insertion position amongst all the valid ones for the text's type. To get the idx of the current element, use GetCurTxtIdx.
nTxtId
The id of the text to insert.
nReferenceBasketId
Id of the initial basket for the referenced object selection dialog - if it is 0 the dialog starts in the same basket of the last selected object of the same kind (picture or multi-media or URL). If it is -1, will insert a photo element not referencing a picture.
strReferenceDlgPars
List of the fields that appear in the dialog to create a new dummy picture (see Configurable dialogs for details on such fields list). If strReferenceDlgPars is empty the user is prompted only for name, width, height and type of the dummy picture.
Remarks
The candidates are all texts which are stored in the selected basket, are neither spiked nor black, are not part of any article, and have allowed types for the given article.
If the type of the text being inserted requires a referenced object (i.e. a picture, multi-media or URL element) the user is also prompted to choose it using a standard object selection dialog. Note that in such a case when selecting a picture it is also possible to create a new dummy one.
The nReferenceBasketId can be also negative, thus not prompting to select the referenced picture or multi-media object when inserting article elements that reference pictures or multi-media.
Context
Article object
See also
InsChildNode, InsNewTxt, InsNodeAtCur, InsObj, InsObjDlg, InsTxtDlg.