Jamie Garroch (MVP)
asked on
Programmatic change (via VB) to format bullet style not working in PowerPoint Slide Master view
I have some code which sets various properties for the Bullet part of the ParagraphFormat for a shape's TextFrame. None of it appears to work for a placeholder shape on a slide master.
For example, if you take the standard default Office template and select a body placeholder shape with some bulleted text in it, this line will turn off the bullet in the first paragraph:
For example, if you take the standard default Office template and select a body placeholder shape with some bulleted text in it, this line will turn off the bullet in the first paragraph:
ActiveWindow.Selection.ShapeRange(1).TextFrame2.TextRange.Paragraphs(1).ParagraphFormat.Bullet.Visible=msoFalse
However, if you select a body or content placeholder shape in the Slide Master which has bulleted text in it e.g. paragraph 1 = "Edit Master text styles" then the command doesn't work. Reading the property returns true as expected but attempting to set it to false appears to be ignored, without raising an error.
ASKER
Interesting JSRWilson. It appears to be related to the template I'm using. See attached stripped down file (rename .zip to .pptx)
slide-master-VBA-bullet-format-test.zip
slide-master-VBA-bullet-format-test.zip
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Grrr. I thought I had checked that! I need some sleep.
You're talking to a man whose been programming since 5 am!
ASKER
JSRWilson - I found out why the layout was broken. If I take a standard MSO template, open Slide Master View, select the content placeholder on a suitable layout where the first level/paragraph has a bullet and enter this in the immediate window:
Now if write the same value to the same property:
Tell me that's not a MSFT bug!
?ActiveWindow.Selection.ShapeRange(1).TextFrame2.TextRange.Paragraphs(1).ParagraphFormat.Bullet.Type=msoBulletUnnumbered
It returns True.Now if write the same value to the same property:
ActiveWindow.Selection.ShapeRange(1).TextFrame2.TextRange.Paragraphs(1).ParagraphFormat.Bullet.Type=msoBulletUnnumbered
I can no longer edit the bullet style in the PowerPoint UI and hence the layout is effectively broken.Tell me that's not a MSFT bug!
http://screencast.com/t/NvxPSXyb0L