Object Model Reference : Classes : T : TextRange : Methods : TextRange.SetLineSpacing |
Sub SetLineSpacing(Type As cdrLineSpacingType, [LineSpacing As Single = -1], [ParaBefore As Single = -1], [ParaAfter As Single = -1])
Member of TextRange
The SetLineSpacing method sets the line-spacing properties for a text range.
The following VBA example sets the line spacing to a percentage of the character height, verifying that the option was applied.
Sub Test() |
Dim d As Document |
Dim s As Shape |
Dim t As Text |
Set d = CreateDocument |
Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is " & _ |
"sample text to illustrate the line spacing in the " & _ |
"TextRange object.") |
Set t = s.Text |
t.Story.SetLineSpacing cdrPercentOfCharacterHeightLineSpacing, 0.3, 0.2, 0.4 |
If t.Story.LineSpacingType = cdrPercentOfCharacterHeightLineSpacing Then |
If t.Story.LineSpacingType = cdrPercentOfCharacterHeightLineSpacing Then |
MsgBox "The line spacing is set to a percentage of the " & _ |
"character height." |
End If |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.