Function Formats Justifies Class

OffsetTextBlock

Offset the lines of text within a string. The string should consist of lines of text which are each separated by vSeparator strings.

Signature (Visual Basic / VBA)

Public Function OffsetTextBlock( _
      ByVal vText As Variant _
    , Optional ByVal vOffsetX As Variant _
    , Optional ByVal vOffsetY As Variant _
    , Optional ByVal vSeparator As Variant _
    ) As Variant

Code Example

    ? WrapText(Preamble, 40)
    We the people of the United States, in
    order to form a more perfect union,
    establish justice, insure domestic
    tranquility, provide for the common
    defense, promote the general welfare,
    and secure the blessing of liberty to
    ourselves and our posterity, do ordain
    and establish the Constitution of the
    United States of America.
    ? OffsetTextBlock(WrapText(Preamble, 40), 5)
         We the people of the United States, in
         order to form a more perfect union,
         establish justice, insure domestic
         tranquility, provide for the common
         defense, promote the general welfare,
         and secure the blessing of liberty to
         ourselves and our posterity, do ordain
         and establish the Constitution of the
         United States of America.

Parameters

Parameter Description
vText String containing lines of text which form a block or paragraph. Function returns Null if vText is Null or cannot be fixed up to a String.
vOffsetX The number of characters to be added to (positive values) or removed from (negative values) the indent of each non-blank line. vOffsetX defaults to 0 (zero) if it is missing or Null or cannot be fixed up to a number.
vOffsetY The number of blank lines to be added to (positive values) or removed from (negative values) the beginning of the text block. vOffsetY defaults to 0 (zero) if it is missing or Null or cannot be fixed up to a number.
vSeparator The string which separates the lines of text in string vText. vSeparator defaults to carriage return and new line characters if it is missing or Null or cannot be fixed up to a String.