Link to home
Start Free TrialLog in
Avatar of Ed_OTI
Ed_OTI

asked on

How can VB/VSTO make 0. the first numeric label of a list in PowerPoint

At the user interface we can make a list of numbered bullets start at 0 rather than 1 by making a numbered list with 0. inserted in front of the first text and then backspacing to wipe out the original 1 bullet:

1. 0. Zero
2. One
3. Two

Now backspace before the 0 to wipe out the 1 then PowerPoint will use the 0 as the numeric bullet and adjust the subsequent bullets:

0. Zero
1. One
2. Two

Another technique is to start a list with no bullets and type the 0. Zero line, then type the 1. One line and PowerPoint will see that you are starting a list and turn the lines into a numeric list starting with 0.

My question is how to automate this using VB when creating slides with Office 2007 or 2010 VSTO.

VSTO appears to be an esoteric art, so I am giving 500 points for what could be 2 lines of code!
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
Avatar of Ed_OTI
Ed_OTI

ASKER

I examined the .xml files in the .pptx (.zip file format) and saw that backing off the 1. leaving the 0. at the front was not making a Arabic numbered list, but just an unnumbered line that happened to start with 0..

I figured I would make an unnumbered list and put in all the numbers. Your code setting the .Bullet = msoFalse makes the fix a "one-liner" -- Thanks!

Ed
Avatar of Ed_OTI

ASKER

The .Bullet = msoFalse did not work because .Bullet is read-only and contains other properties. The following code works:

 .Paragraphs(1).ParagraphFormat.Bullet.Type = PowerPoint.PpBulletType.ppBulletNone

That is the "Magic Bullet" (pun intended) that makes it work.

Thanks again,

Ed