Consulting

Results 1 to 2 of 2

Thread: VBA - Setting Bulletpoint indent to 'Hanging' special

  1. #1

    VBA - Setting Bulletpoint indent to 'Hanging' special

    Hi internet,

    I'm trying to write a macro to format the indentation of a bullet in Powerpoint - and I haven't found an existing solution to this problem yet on the internet.

    Effectively. I'm trying to set:

    Indentation Before Text: 0.3cm
    Special: Hanging
    By: 0.3cm

    Now I can manipulate the indentation with

    Shape.TextFrame.Ruler.Levels(1).LeftMargin and .FirstMargin, but I cannot set the Special hanging style to "Hanging" as opposed to "First Line"

    Without this I'm unable to precisely control how I want my bullet to look.

    Does anyone know what is the appropriate property to control the Special style here?

    Thank you very much!

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    You are using legacy code.

    To do this you need to use the new code for TextRange2 that came from v. 2007

    See if this does it

    Sub fixindent()Dim oshp As Shape
    Dim otr2 As TextRange2
    Set oshp = ActiveWindow.Selection.ShapeRange(1)
    Set otr2 = oshp.TextFrame2.TextRange
    With otr2.ParagraphFormat
    .LeftIndent = 0.3 * 28.3465
    .FirstLineIndent = -(0.3 * 28.3465)
    End With
    End Sub
    Or depending on exactly what you mean

    Sub fixindent()Dim oshp As Shape
    Dim otr2 As TextRange2
    Set oshp = ActiveWindow.Selection.ShapeRange(1)
    Set otr2 = oshp.TextFrame2.TextRange
    With otr2.ParagraphFormat
    .LeftIndent = 0.6 * 28.3465
    .FirstLineIndent = -(0.3 * 28.3465)
    End With
    End Sub
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

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