gmaxey
01-17-2013, 11:26 AM
I have a theme applied to my normal template that has the following theme fonts:
Cambira (Headings) and Times New Roman (Body)
When I use the built-in Find utility, I leave the "Find what:" field empty and I then click "More>Format>Font" and select the +Body as the font to find. This results in "+Body (Times New Roman)" appearing under the find what field. If I click "Find Next" the next instance of the text so formatted is selected.
Attempting the same thing with VBA:
Sub ScratchMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Text = ""
.Font.Name = "+Body (" & ActiveDocument.DocumentTheme.ThemeFontScheme.MinorFont.Item(1).Name & ")"
.Format = True
.Forward = True
.Wrap = wdFindStop
While .Execute
MsgBox oRng.Text
oRng.Collapse wdCollapseEnd
Wend
End With
End Sub
The text is not found. What I am missing here?
Cambira (Headings) and Times New Roman (Body)
When I use the built-in Find utility, I leave the "Find what:" field empty and I then click "More>Format>Font" and select the +Body as the font to find. This results in "+Body (Times New Roman)" appearing under the find what field. If I click "Find Next" the next instance of the text so formatted is selected.
Attempting the same thing with VBA:
Sub ScratchMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Text = ""
.Font.Name = "+Body (" & ActiveDocument.DocumentTheme.ThemeFontScheme.MinorFont.Item(1).Name & ")"
.Format = True
.Forward = True
.Wrap = wdFindStop
While .Execute
MsgBox oRng.Text
oRng.Collapse wdCollapseEnd
Wend
End With
End Sub
The text is not found. What I am missing here?