View Single Post
 
Old 03-31-2014, 02:22 PM
Larry Sulky Larry Sulky is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Mar 2014
Posts: 14
Larry Sulky is on a distinguished road
Default

You're on the right track. First find which paragraphs are wholly bold (or italic, or whatever), which ones are partially, and which ones are not. Then for the partial ones, use a similar kind of logic to discover which words are wholly, partially, or not bolded etc. Then for those partial ones, go down to the character leve. In every case, 0 means no, -1 means yes, and 9999999 means partial. You'll need to examine properties as shown on the debug.print statements below (fully expressed for clarity, but ugly):

Code:
Dim para As Integer
Dim word As Integer
Dim char As Integer

para = 3
word = 6
char = 5

Debug.Print ActiveDocument.Paragraphs.Item(para).Range.Bold
Debug.Print ActiveDocument.Paragraphs.Item(para).Range.Words.Item(word).Bold
Debug.Print ActiveDocument.Paragraphs.Item(para).Range.Words.Item(word).Characters(char).Bold
Obviously, you wouldn't just set specific values for the indexes para, word, and char; you would nested-loop through them (like your original sample shows for paragraphs).
Reply With Quote