Remove bullet and hanging indent from first paragraph in a text boxcontaining bulleted items.

T

tangotom

This is basically a response to a posting of five years ago (http://
groups.google.com/group/microsoft.public.powerpoint/browse_thread/
thread/d5d20184812fcb61/e62bffeebe86505f?hl=en&#e62bffeebe86505f)
where someone wanted to know a vba code way to remove the hanging
indent from the first paragraph in a text box containing bulleted
items. I came across it in hopes of finding a solution. I did figure
out a solution, and I offer it here for others.

The trick is to alter the text range object so that bulleting starts
at the second paragraph, and also starting at the second paragraph the
indent level changes to 2. Then, you just need to set the ruler
levels for the first level (the first paragraph) and the second level
(the rest of the paragraphs). Here is the code:

shpTextBox.TextFrame.TextRange.Paragraphs(Start:=2,
Length:=20).ParagraphFormat.bullet.Type = ppBulletUnnumbered
shpTextBox.TextFrame.TextRange.Paragraphs(Start:=2,
Length:=20).IndentLevel = 2
'Code to set indent and hanging
With shpTextBox.TextFrame.Ruler
.Levels(1).FirstMargin = 0
.Levels(1).LeftMargin = 0
.Levels(2).FirstMargin = 0
.Levels(2).LeftMargin = 20
End With

Hope this is of use to someone.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top