Would like to figure out how to remove bold from text (unbold) within a list and leave bolded text elsewhere as is.
I found this code which seems to show the type of list [tt]Selection.Range.ListFormat.ListType[/tt] and that showed the list type as 3, when I put into vba after trial and error it intellisensed as wdListSimpleNumbering. I am not so familiar with word vba. I had found an example with style, but since the code was mentioning listformat and listtype, it errored out when I tried to use that in the style example. "Can't assign to a read only property".
BEFORE...
[pre]
This is a bolded sentence that should remain bold.
1. This is the first question?
a. This is an answer
b. This is the correct answer
c. This is another answer
d. All of the above
[/pre]
AFTER...
[pre]
This is a bolded sentence that should remain bold.
1. This is the first question?
a. This is an answer
b. This is the correct answer
c. This is another answer
d. All of the above
[/pre]
I found this code which seems to show the type of list [tt]Selection.Range.ListFormat.ListType[/tt] and that showed the list type as 3, when I put into vba after trial and error it intellisensed as wdListSimpleNumbering. I am not so familiar with word vba. I had found an example with style, but since the code was mentioning listformat and listtype, it errored out when I tried to use that in the style example. "Can't assign to a read only property".
BEFORE...
[pre]
This is a bolded sentence that should remain bold.
1. This is the first question?
a. This is an answer
b. This is the correct answer
c. This is another answer
d. All of the above
[/pre]
AFTER...
[pre]
This is a bolded sentence that should remain bold.
1. This is the first question?
a. This is an answer
b. This is the correct answer
c. This is another answer
d. All of the above
[/pre]
Code:
Sub RemoveBoldFromBulletList()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
Selection.Range.[highlight #FCE94F]ListFormat.ListType = 3[/highlight]
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
'Selection.Find.Execute Replace:=wdReplaceAll
Selection.Font.Bold = False