We’re trying to create a PowerPoint slide programmaticaly. We can obtain bullets on a single level, but playing with tabs and line returns doesn’t work for nested enumerations.
For now we get:
- text 1
- subtext1
- subtext2
- text 2
And what we want is :
- text 1
- subtext1
- subtext2
- text 2
Is there a way to control these using C# or VBA?
First, get a reference to the
Paragraphsof theTextRange2, as each bulleted item is a paragraph (really aTextRange2).The last four lines call a function that encapsulates the logic of setting the indent “level,” which affects the style of bullets and text, and the actual indent of the bullets and text:
You could certainly refactor this to meet your needs — like passing the indent factor (I hardcoded it as 40, but your mileage may vary).