Capitalizing numbered lists

P

Paul B

Hi,

I'm running into a noisome problem, in that numbered lists do not
automatically capitalize their first word.

I've been playing with a solution, but working with Find picks up
neither the starting number of each paragraph, which I believe is
a graphic, or the tab space that seems to be after it. So I've
been unable to get to that first word to capitalize it.

Does anyone have a solution for this?

Thanks,
p.
 
G

Greg Maxey

I suppose that most would stand alone as a sentence so you might use:

Sub ScracthMacro()
Dim oListItem As Range
For Each oListItem In ActiveDocument.Range.Sentences
oListItem.Characters.First = UCase(oListItem.Characters.First)
Next
End Sub
 
P

Paul B

Thanks, Greg. That works great.

Does any way to restrict the work load occur to you? I'm
concerned that parsing every sentence would be a lot in a big
file?

Thanks,
Paul
 
G

Greg Maxey

Paul,

Yes. You could work with the collection of ListParagraphs only:

Sub Scratchmacro()
Dim oListParagraph As Paragraph
For Each oListParagraph In ActiveDocument.ListParagraphs
oListParagraph.Range.Characters.First =
UCase(oListParagraph.Range.Characters.First)
Next oListParagraph
End Sub
 

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