TxtFormatList Method

Build 1501 on 14/Nov/2017  This topic last edited on: 23/Mar/2016, at 12:18

Description

Returns the list of format ids and names, according to specified conditions.

Syntax

Dim aFormats As List(Of IdName)  = Ted.TxtFormatList(Mode, JustScopeId, TypeId, categoryIds, Depth)

Mode        

Mode: If Mode=0 the list contains all the format that are valid for the current text.

If Mode=1 or if there is not current text the list contains all the formats matching the specified title, type, category and geometry (if type or category or depth are 0 they are ignored in the matching).

If Mode=2 the list contains all the 'generic' formats for the specified title - i.e. all the formats that are not specific to a type, category or geometry depth.

JustScopeId

Typography id. To get the current one, use FredApp.CurJustScopeId.

TypeId

Type id. To get it from the name, use Fred.GetTypeIdFromName(photoname)

CategoryIds

Category filter: Define it as Dim catList = New List(Of Integer) and then enter as catlist. If empty, allows for all categories.

Depth

Depth filter: use 0 for all depths.

Return value

List of IdName

Example

    Dim catList = New List(Of Integer)

    Dim aFormats As List(Of IdName) = Ted.TxtFormatList(0, FredApp.CurJustScopeId, Fred.GetTypeIdFromName(photoname), catList, 0)

    Dim istr As String = ""

    For Each item As IdName In aFormats

      istr = istr & item.Id & " " & item.Name & Chr(13) & Chr(10)

    Next

    MsgBox(istr)

Context

Main application common dispatcher commands

See also

TxtFormatDlg, TxtFormatName, TxtFormat, GetFormat, Format object