GetParaStyleType Script

Build 1501 on 14/Nov/2017  This topic last edited on: 9/May/2012, at 13:03

Description

Returns the formatting type of the current paragraph: H=headline format, B=body format, F=other style, 0-no style.

Can be used only if names of your headline styles start with whatever is specified as your head element name, e.g. "head" (beware - but not "Head"!), and body styles with bodyname.

Syntax

sResult = GetParaStyleType

Code

Function GetParaStyleType()

  ' Returns formatting type of cur.para: H=headline format, B=body format, F=other style, 0-no style

  ' Can be used only if names of your headline styles start with whatever is specified as your head element name, e.g. "head" (beware - but not "Head"!), and body styles with bodyname

   GetParaStyleType = False

  If Text.TestTextParaStyle("*") Then

    If Text.TestTextParaStyle(EdConfig.headname & "*") Then

       GetParaStyleType = "H"

    ElseIf Text.TestTextParaStyle(EdConfig.bodyname & "*") Then

       GetParaStyleType = "B"

    Else

       GetParaStyleType = "F"

    End If

  Else

     GetParaStyleType = "0"

  End If

End Function

 See also

GetAllTags, GetParaCmds