PDA

View Full Version : Format Identation of Bulleted List



To_Kre
03-16-2015, 09:07 AM
Hello all,

Up to now I could sole most of my problems/qustions by myself simply searching for already existing threads in this Forum - Thanks for the good work. Unfortunately this did not work for my current problem, so I thought I give it a try :)

On PowerPoint 2007, I am new to VBA and just recently started programming some useful marcos to automate/simplify slide development. On one of them, I am trying to add shapes to a slide with a predefined bullet list. All works fine, except of getting the indentation right.

This means defining the space between bullet and text as well as defining the indentation for the different level of the bullet list.

I would like my shape to look like the one on the left hand side. However I just managed to format it to get the result shown on the right hand side:

13019

I tried a couple of different lines, however never managed to get the proper result. It would be great if anyone could help me out with this. Please appologize my code formatting (as I said I am pretty new to VBA - all suggestions are warmly welcomed). Thanks!

Currently my code concerning this part of the macro looks like:


'add first shape to the currently viewed slide
Set row1 = sld.Shapes.AddShape(msoShapeRectangle, _
Left:=35.999, Top:=195.587, Width:=308.971, Height:=120)

'customize shape
row1.Fill.Visible = msoFalse
row1.Line.Visible = msoTrue
row1.Line.Weight = 1#
row1.Line.ForeColor.RGB = RGB(0, 40, 104)

'Add and configure text
row1.TextFrame.TextRange.Text = "Headline" _
+ Chr$(CharCode:=13) + "Text" + Chr$(CharCode:=13) + "Text" _
+ Chr$(CharCode:=13) + "Text" + Chr$(CharCode:=13) + "Text"

row1.TextFrame.TextRange.Font.Size = 14
row1.TextFrame.TextRange.Font.Name = "Verdana"
row1.TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignLeft
row1.TextFrame.VerticalAnchor = msoAnchorTop


row1.TextFrame.TextRange.Paragraphs(3).IndentLevel = 2
row1.TextFrame.TextRange.Paragraphs(4).IndentLevel = 3
row1.TextFrame.TextRange.Paragraphs(5).IndentLevel = 4

With row1.TextFrame.TextRange.Characters(1, 8)
.Font.Color.RGB = RGB(0, 174, 239)
.Font.Bold = msoTrue

End With

With row1.TextFrame.TextRange.Characters(9, 16)
.Font.Color.RGB = RGB(0, 40, 104)
.Font.Bold = msoFalse

End With
With row1.TextFrame.TextRange.Characters(10, 0)
.ParagraphFormat.Bullet.Character = 8226
.ParagraphFormat.Bullet.RelativeSize = 0.7

End With

With row1.TextFrame.TextRange.Characters(15, 0)
.ParagraphFormat.Bullet.Character = 45
.ParagraphFormat.Bullet.RelativeSize = 1.2

End With

With row1.TextFrame.TextRange.Characters(20, 0)
.ParagraphFormat.Bullet.Character = 43

End With

With row1.TextFrame.TextRange.Characters(25, 0)
.ParagraphFormat.Bullet.Character = 46

End With

RandomGerman
04-07-2015, 12:09 AM
Hi all,

I have a similar Problem, so I would be very interested in a solution for this, too. Thanks a lot!