how to change bullet styles by using VBA

  • Thread starter Thread starter vanhalsen
  • Start date Start date
V

vanhalsen

Hi there,

my problem is that i would like to create a textbox with some "dummy"
bullets. How do i set the style for the lower level bullets?

I used the ParagraphFormat command to set up the style for the first
level, but i don't know how to do it for the others.

many thanks in advance

vanhalsen
 
Shyam,

I think he wants to do it in advance. That is, he wants to set up a text
box so he can type paragraphs, hit the demote button, and type some more.
The VBA is used to set the bullets for the current paragraph (easy), and
future demoted paragraphs (possible?).

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
Also, other than in a placeholder, I don't think you can do this with or
without VBA, but I would love to be wrong about this.
--David

Shyam,

I think he wants to do it in advance. That is, he wants to set up a
text box so he can type paragraphs, hit the demote button, and type
some more. The VBA is used to set the bullets for the current
paragraph (easy), and future demoted paragraphs (possible?).

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
Vanhalsen,
Not sure why you cannot set the format for the rest of the paragraphs. Each
paragraph can be formated by specifyings its paragraph format.

Activewindow.Selection.TextRange.Paragraphs(X).ParagraphFormat....
where X represents the paragraph you are formatting.

My tuppence:

If the text box is newly created and has only one line of text, then X will
never be greater than 1. IOW, you can't apply formatting to paragraphs that
haven't been added.

I'd love to know of a better way but to "pre-format" a text box that contains
no multi-paragraph text yet, I've always had to ADD the text, format it to
taste, then delete it (restoring any original text if need be).

Seems that if you do that, PPT then remembers the applied paragraph level
formatting when you later add text. Otherwise, no.
 
OK. Will PowerPoint remember it if it is added with code. If so,
Vanhalsen is in business. He can use the code to add several paragraphs,
format them to his liking, and delete all the paragraphs. Somehow, I'm
guessing that's not going to work, but I don't have time to try it now.
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
David M. said:
OK. Will PowerPoint remember it if it is added with code. If so,
Vanhalsen is in business. He can use the code to add several paragraphs,
format them to his liking, and delete all the paragraphs. Somehow, I'm
guessing that's not going to work, but I don't have time to try it now.
--David

Yup, that's what I was trying to suggest in my obscurantist little fashion.

Grab the existing text in a string variable
Add new text at each paragraph level and format it
Replace the new text with the saved original text

The only other hitch I know of is that PPT doesn't let you set indents in
normal text boxes with just the tab key, though you can use the promote/demote
buttons on the Outline toolbar to do the job.

A weird and sometimes frustrating inconsistency, that one, but I can sorta see
why it works that way. Sorta.
 
Steve,

thanks for your advice, but i am still too stupid. I tried two
different ways:

a) i created a textbox containing 3 paragraphs added bullet styles and
indent to each of them. So Paragraph(1) is Bullet level 1, Paragraph(2)
is Level 2, ..... but it still does not keep the formatting when i
delete the text

b) i created a textbox containing 1 paragraph added bullet style,
demoted it added another style, etc.

but it still does not keep the formatting. any ideas?

what i need to have is a text box containing a first bullet saying "add
text" here, and if some demote or promote it should switch to the
defined bullet style

thanks
 
Vanhalsen said:
Steve,

thanks for your advice, but i am still too stupid. I tried two
different ways:

a) i created a textbox containing 3 paragraphs added bullet styles and
indent to each of them. So Paragraph(1) is Bullet level 1, Paragraph(2)
is Level 2, ..... but it still does not keep the formatting when i
delete the text

b) i created a textbox containing 1 paragraph added bullet style,
demoted it added another style, etc.

but it still does not keep the formatting. any ideas?

what i need to have is a text box containing a first bullet saying "add
text" here, and if some demote or promote it should switch to the
defined bullet style

I don't think you'll be able to do this manually. Or at least both of us are
too stupid and maybe some kind, smarter person will come along and clue us both
in, 'cause I can't make it work manually either.

VERY frustrating.
 
Back
Top