PDA

View Full Version : "Smart" bullet point behavior



zxmon21
03-10-2012, 03:05 PM
Sorry about the poor title, but I don't know the proper term to describe it. Let me explain what I mean.

In our PowerPoint template, we have a bullet scheme defined in (I think) customlayouts. The scheme looks like this:

1st list level (no indent) = no bullet
2nd list level = square bullet
3rd and 4th list level = line bullet

http://i111.photobucket.com/albums/n135/zxmon21/Capture.png

In the template, there are text boxes (shape.type = 17) with a behavior that I would like to reproduce. Let me describe.
When user uses the "increase list level" or "decrease list level" buttons, the bullets change accordingly. The tab-key has the same effect, if used in the right way.

Now, the big question: How can I get this behavior for any text box? When I manually (or by macro) set
textrange.Paragraphs(i).ParagraphFormat.Bullet.Character, this destroys the behavior, even in previously "automatic" text boxes. Very annoying.

Do you have any idea how I can set achieve this list level behavior for text boxes of my choice?

It might already help if you can point to what this behavior is called, or how the list level bullet pattern is determined in the first place.

All help is welcome!

So far this is my workaround, but it breaks the automatic behavior.

With MyTextRange
For i = 1 To .Paragraphs.Count
.Paragraphs(i).ParagraphFormat.Bullet.RelativeSize = 1
Select Case .Paragraphs(i).IndentLevel
Case 1
.Paragraphs(i).ParagraphFormat.Bullet.Character = 110
.Paragraphs(i).ParagraphFormat.Bullet.Type = ppBulletNone
'nothing
Case 2
.Paragraphs(i).ParagraphFormat.Bullet.Type = 1
.Paragraphs(i).ParagraphFormat.Bullet.Type = ppBulletUnnumbered
.Paragraphs(i).ParagraphFormat.Bullet.Character = 110
.Paragraphs(i).ParagraphFormat.Bullet.Font.Name = "Wingdings"
'square
Case Else
'dash
.Paragraphs(i).ParagraphFormat.Bullet.Type = 1
.Paragraphs(i).ParagraphFormat.Bullet.Type = ppBulletUnnumbered
.Paragraphs(i).ParagraphFormat.Bullet.Character = 8211
.Paragraphs(i).ParagraphFormat.Bullet.Font.Name = "Arial"
End Select
Debug.Print .Paragraphs(i).ParagraphFormat.Bullet.Character
Debug.Print .Paragraphs(i).ParagraphFormat.Bullet.Font.Name
Next
End With

John Wilson
03-11-2012, 04:45 AM
If you have a template that does that AS DEFAULT I would love to see it.

I would have said it was impossible but I'd like to be proved wrong!

john ATSIGN pptalchemy.co.uk

zxmon21
03-11-2012, 05:21 AM
Hi John,
I emailed you a sample slide with one "automatic bulleting" and one "broken" text box. Let me know if you can tell what causes the different behavior, I'm definitely in way beyond my VBA-skills here :)

Have a nice Sunday afternoon,

John Wilson
03-11-2012, 06:12 AM
Thanks. I can't instantly see how that was done (I thought you meant the default text box had those properties)

I can have a better look next week. In the meantime I would suggest you play with using TextFrame2 if you are not already doing that.

zxmon21
03-16-2012, 12:39 AM
Hi John,
I did some further investigation, and here's what I found.

I took a text box with "automatic" behavior and compared the XML with a textbox with broken behavior. It turns out that there's only a tiny difference in the XML. Who knows, maybe this will help someone point me to the right VBA to set the broken textbox back to automatic behavior. Here's the diff

In the automatic text box

<a:p>
<a:pPr lvl="1"/>
<a:r>
<a:rPr lang="en-US" dirty="0" smtClean="0"/>
<a:t>Level 1</a:t>
</a:r>
</a:p>


In the broken text box

<a:p>
<a:pPr lvl="1">
<a:buSzPct val="100000"/>
<a:buFont typeface="Wingdings"/>
<a:buChar char="n"/>
</a:pPr>
<a:r>
<a:rPr lang="en-US" dirty="0" smtClean="0"/>
<a:t>Level 1</a:t>
</a:r>
</a:p>


Now the question is: how do I get VBA to bring me back to the "auto" behavior?