Link to home
Start Free TrialLog in
Avatar of Jamie Garroch (MVP)
Jamie Garroch (MVP)Flag for United Kingdom of Great Britain and Northern Ireland

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:

ActiveWindow.Selection.ShapeRange(1).TextFrame2.TextRange.Paragraphs(1).ParagraphFormat.Bullet.Visible=msoFalse

Open in new window

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.
Avatar of John Wilson
John Wilson
Flag of United Kingdom of Great Britain and Northern Ireland image

Seems to work here. What version is this?
http://screencast.com/t/NvxPSXyb0L
Avatar of Jamie Garroch (MVP)

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
ASKER CERTIFIED SOLUTION
Avatar of John Wilson
John Wilson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Grrr. I thought I had checked that! I need some sleep.
You're talking to a man whose been programming since 5 am!
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:

?ActiveWindow.Selection.ShapeRange(1).TextFrame2.TextRange.Paragraphs(1).ParagraphFormat.Bullet.Type=msoBulletUnnumbered

Open in new window

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

Open in new window

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!