Pink Sweetener
Pink Sweetener

Reputation: 153

Make selected text in Word document bulleted (recording doesn't work)

I have an Excel VBA script that generates a Word doc. Some of the generated text in that word doc needs to be listed as a bulleted list (i, ii, iii, iv...). I have gotten as far as highlighting the desired text, which I have succeeded in applying other text effects to, but I cannot get the bulleted list to work. I have tried recording a Word macro for making a bullet list - this macro works on selected text in Word but does not work when I try to apply it in my Excel VBA script.

The following script selects the desired text and makes it Bold. I want it to make the selected text a bullet list using i, ii, iii style bullets instead.

Set rngStart Order.Bookmarks("violations").Range Set rngEnd = _
Order.Bookmarks("violationsEnd").Range Order.Range(rngStart.Start, _
rngEnd.End).Select Order.Range(rngStart.Start, rngEnd.End).Bold = True

Thank you for whatever help you can offer. Have a great weekend!

Upvotes: 0

Views: 274

Answers (1)

ArcherBird
ArcherBird

Reputation: 2134

If you've got your selected text in a Range object, you can apply bulleted list format like this:

Range.ListFormat.ApplyBulletDefault

Upvotes: 1

Related Questions