Consulting

Results 1 to 3 of 3

Thread: Increasing line spacing by a (non) integer number

  1. #1
    VBAX Newbie
    Joined
    Mar 2015
    Posts
    4
    Location

    Increasing line spacing by a (non) integer number

    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

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    To set the line spacing to a given number of points .LineRuleWithin should be set to False however it seems buggy. Try omitting that line altogether
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Newbie
    Joined
    Mar 2015
    Posts
    4
    Location
    Yes it worked John! Thank you very much for this response!

    Best,
    Andreas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •