Signature (Visual Basic / VBA)
Public Function FillText( _
ByVal vValue As Variant _
, ByVal vWidth As Variant _
, Optional ByVal vBiasLeft As Variant _
) As Variant
Code Example
FillText(" This is a test.", 23) = " This is a test."
FillText("This is a long line.", 10) = "This is a long line."
FillText("LineWithNoSpacesHere", 60) = "LineWithNoSpacesHere"
Parameters
| Parameter | Description |
|---|---|
| vValue | String containing words which will be spread-out if the length of the string is less than the desired length of the line. Function returns Null if vValue is Null or cannot be fixed up to a String. |
| vWidth | The desired width of the string after the addition of intra-line spaces. vWidth defaults to 60 (sixty) characters if it is Null or cannot be fixed up to a number. |
| vBiasLeft | True to have words biased towards the left--space will be added to the right side of a word when there is a choice. vBiasLeft defaults to True if it is missing or Null or cannot be fixed up to a number. |
Notes & Version History
| Note | Function returns vValue unchanged if the length of vValue is greater than the desired width vWidth, or if there are no spaces within the line. |