CloseTxt Method

Build 1501 on 14/Nov/2017  This topic last edited on: 22/Mar/2016, at 17:07

Description

Terminates the editing of the specified text.

Available in Ted and Fred.

Syntax

object.CloseTxt nIdx,bAbandonChanges

object

Required. Object name. Returned by Ted.GetActiveArticle, or Fred.GetActiveArticle, e.g. dim objarticle = Ted.GetActiveArticle or dim objarticle = Fred.GetActiveArticle.

nIdx

Index of the text to close, ranging from 0 = first text in the article to NTxts-1 = last text in the article. If nIdx is outside this range a run-time error is raised. To get the idx of the current element, use GetCurTxtIdx.

bAbandonChanges

If false the text is saved; if true the text is not saved and the changes are lost.

Example

This script closes the editing of the article text element, and saves changes.

If Ted.HasActiveArticle Then

 dim objArticle = Ted.GetActiveArticle

 dim ICurId as Integer = objArticle.GetCurTxtIdx

 objArticle.CloseTxt (iCurId, false)

End If

This script closes the editing of all article text elements, and saves changes.

If Ted.HasActiveArticle Then

 dim objArt = Ted.GetActiveArticle

 dim i as Integer

 For i=0 To objArt.NTxts-1

   objArt.CloseTxt (i, False)

 Next

End If