SetPar Method

Build 1501 on 14/Nov/2017  This topic last edited on: 10/Oct/2016, at 13:11

Description

Sets the value of the nIdx parameter of the style associated with the object.

nIdx must be between 0 (first parameter) and NPars-1 (last parameter). A run-time error occurs if nIdx is outside the valid range or if the object does not have an associated style. This property can be used both to query and to set the value of the parameters. Note that in the latter case the value is validated against the style's attributes, e.g. an integer parameter must be inside the valid range, a font parameter must be the code of a valid font and so on. Attempts to use a non valid value will cause a run-time error.

Syntax

object.SetPar (nIdx, value)

object

Required. Object name, returned by Text.GetTextStyle and GetParaStyle.

nIdx

Required. nIdx must be between 0 (first parameter) and NPars-1 (last parameter). A run-time error occurs if nIdx is outside the valid range or if the object does not have an associated style.

value

Required.  Must be an acceptable typographical value.

Example

  Public Overridable Sub EditResizeHeadDecr()

    Dim objStyle = Text.GetParaStyle

    If objStyle.GetName = "" Then

      objStyle.SetName("head3")

      objStyle.SetPar(0, Units.ToVal("36pt"))

      Text.SetParaStyle(objStyle)

    End If

    HeadSize(objStyle, 1004, -1, 2000, 96000)

    objStyle.Dispose()

  End Sub