Macros Property

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

Description

Returns an array of tag names of the hidden styles in all linked libraries of the selected format.

Syntax

object.Macros (i)

object

Required. Object name. Returned by Dim objFormat = Ted.GetFormat or Dim objFormat = Fred.GetFormat.

i

Required. Index in the range of LBound(aMacros) To UBound(aMacros).

Example

Public Function HasTag(ByVal strTagName As String) As Short

  ' lookup for tag name in current format, returns 0 if not found

  ' or 1=para style; 2=character style; 3=hidden style

  Dim objFormat = Ted.GetFormat

   objFormat.Id = Ted.GetActiveTxt.FormatId

  Dim aParaStyles = objFormat.ParaStyles

 

  For Each Style As String In objFormat.ParaStyles

    If Style = strTagName Then Return 1

  Next

 

  Dim aTextStyles = objFormat.TextStyles

  For Each Style As String In objFormat.TextStyles

    If Style = strTagName Then Return 2

  Next

 

  Dim aMacros = objFormat.Macros

  For Each Style As String In objFormat.Macros

    If Style = strTagName Then Return 3

  Next

  Return 0

End Function

Context

Property

See also

NStyleLibs, StyleLib, TextStyles, ParaStyles.