VBA Macro Powerpoint for formatting selected text


  • 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

    vendredi 11 mai 2012 23:04


Toutes les réponses