none
VBA Macro Powerpoint for formatting selected text RRS feed

  • Question

  • My objective is to be able to format selected text regardless of whether it is in a textbox or table

    I currently have the following code, this works fine in changing the font and inserting bullet points, but I cannot seem to indent the bullet points. 

    Although not shown below, i have tried various code snippets using, indentlevel and ruler etc, however, all seem to generate an error i.e. textframe not part of.....

    I think this is a simple code, but I am can not seem to figure this out, can anyone provide a code snippet, that will allow me to bullet point and indent any selected text, regardless of the container its in i.e. textbox, or table. Thanks

    Sub setTextDetails()
     With ActiveWindow.Selection.TextRange.Font
    .Name = "Arial"
    .Size = 9
    .Bold = msoFalse
    .Italic = msoFalse
    .Underline = msoFalse
    .Shadow = msoFalse
    .Emboss = msoFalse
    .BaselineOffset = 0.3
    .AutoRotateNumbers = msoFalse
    .Color.SchemeColor = ppForeground

      With ActiveWindow.Selection.TextRange
                .Paragraphs.ParagraphFormat.Alignment = ppAlignLeft
                .Paragraphs.ParagraphFormat.Bullet.Type = ppBulletUnnumbered
                .Paragraphs.ParagraphFormat.Bullet.Visible = msoTrue
                
    End With
    End With        
    End Sub

    Friday, May 11, 2012 11:04 PM

Answers

  • This should work, where x is the indentlevel value (1,2,..)

    Activewindow.Selection.TextRange.IndentLevel = x


    Regards, Shyam (http://skp.mvps.org)

    Saturday, May 12, 2012 3:56 PM

All replies

  • This should work, where x is the indentlevel value (1,2,..)

    Activewindow.Selection.TextRange.IndentLevel = x


    Regards, Shyam (http://skp.mvps.org)

    Saturday, May 12, 2012 3:56 PM
  • Activewindow.Selection.TextRange.IndentLevel = x

    this work fine in textbox

    But no impact in Table

    How can we indent selected text bullet in a table

    I am using Powerpoint 2010

    Tuesday, August 13, 2013 3:48 PM
  • I've seen this happen when there is a bullet text. The indent level gets set however there is no update in the UI. You can use:

    CommandBars.ExecuteMso("IndentIncrease")


    Regards, Shyam (http://skp.mvps.org)

    Tuesday, August 13, 2013 4:40 PM
  • Thanks shyam,

    I tried another method also

    ActiveWindow.Selection.TextRange2.ParagraphFormat.LeftIndent = x

    Is it a right method??

    Wednesday, August 14, 2013 1:54 PM
  • That property is an absolute value in points. Use it if you are getting the desired results.

    Regards, Shyam (http://skp.mvps.org)

    Wednesday, August 14, 2013 4:02 PM