Description
Opens a dialog to set the format for the selected text. If no frame is selected, sets the format for the current story.
Syntax
Page.TxtFormat |
Example
This script sets the same format to all elements of an article:
Public Overridable Sub SetFormatOnAllElements()
' sets the format on all elements of the current article
' v1 on 18/Mar/13 (BS)
If Page.TxtFormat = GLOB.EOK Then
Dim strname As String = ""
Dim objid = Page.GetSelectedId
If Ted.HasActiveTxt Then strname = Ted.GetActiveTxt.FormatName
If Ted.HasActiveArticle And strname <> "" Then
Dim objArt = Ted.GetActiveArticle
Dim nIdx = objArt.GetCurTxtIdx
For i = 0 To objArt.NTxts - 1
Dim objNode = objArt.GetTxtNode(i)
If objNode.IsLinked Then
objArt.GotoTxtEx(i, False, True, 2)
If objArt.GetTxtNode(i).TypeName <> "mobile" Then Page.TxtFormatName(strname)
objArt.CloseTxt(i, False)
End If
Next
If nIdx >= 0 Then
Dim objNode = objArt.GetTxtNode(nIdx)
If objNode.IsLinked Then
objArt.GotoTxtEx(nIdx, False, True, 2)
If objArt.GetTxtNode(nIdx).TypeName <> "mobile" Then Page.TxtFormatName(strname)
objArt.CloseTxt(nIdx, False)
End If
Else
If objArt.NTxts > 0 Then
Dim objNode = objArt.GetTxtNode(0)
If objNode.IsLinked Then
objArt.GotoTxtEx(0, False, True, 2)
If objArt.GetTxtNode(0).TypeName <> "mobile" Then Page.TxtFormatName(strname)
objArt.CloseTxt(0, False)
End If
End If
End If
End If
End If
End Sub
Context
Page designer
See also
TxtAssignFormat, TxtFormatList, TxtFormatName