askou
06-22-2015, 08:48 PM
Hi All,
I am trying to create a macro that increases line spacing (i.e. spacewithin) by 0.1 pts. The code I have written so far is:
Sub Macro8(control As IRibbonControl)
Dim Shp As Shape
If ActiveWindow.Selection.Type = ppSelectionNone Then
' Nothing!
Else
For Each Shp In ActiveWindow.Selection.ShapeRange
With Shp
.TextFrame2.TextRange.ParagraphFormat.LineRuleWithin = msoTrue
.TextFrame2.TextRange.ParagraphFormat.SpaceWithin = .TextFrame2.TextRange.ParagraphFormat.SpaceWithin + 0.1
End With
Next Shp
End If
End Sub
Issue is that when the code runs linespacing becomes 0.1 instead of increasing by 0.1. While I can set directly line spacing to a particular non integer value such as 1.2, it seems impossible to increase it by 0.1 or a non integer number.
Has anybody encountered a similar problem or has a recommendation on how to solve it?
Thanks,
Andreas
I am trying to create a macro that increases line spacing (i.e. spacewithin) by 0.1 pts. The code I have written so far is:
Sub Macro8(control As IRibbonControl)
Dim Shp As Shape
If ActiveWindow.Selection.Type = ppSelectionNone Then
' Nothing!
Else
For Each Shp In ActiveWindow.Selection.ShapeRange
With Shp
.TextFrame2.TextRange.ParagraphFormat.LineRuleWithin = msoTrue
.TextFrame2.TextRange.ParagraphFormat.SpaceWithin = .TextFrame2.TextRange.ParagraphFormat.SpaceWithin + 0.1
End With
Next Shp
End If
End Sub
Issue is that when the code runs linespacing becomes 0.1 instead of increasing by 0.1. While I can set directly line spacing to a particular non integer value such as 1.2, it seems impossible to increase it by 0.1 or a non integer number.
Has anybody encountered a similar problem or has a recommendation on how to solve it?
Thanks,
Andreas