D
DeeW
I am using Word 2003 and have a document where the headings are in
uppercase. When inserting a cross-reference the headings appear the same. I
would like to have the crossreference to be in sentence case. I followed
Graham Mayor's instructions from 6/29/2007 and created a Macro to globally
make the changes. However, I have a subsection and it now appears
capitalized. For example, the reference appears as SECTION 2(b) and when I
run the macro, it displays as Section 2(B) instead of Section 2(b). Any text
inside the parathensis should be ignored.
How can I fix this? Mr. Mayor's original macro code is below. Thanks.
Sub AddFirstCapSwitch()
ActiveWindow.View.ShowFieldCodes = True
With Selection.Find
.ClearFormatting
.Text = "^d REF"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = False
Do While .Execute
With Selection
.MoveRight Unit:=wdCharacter, Count:=1
.MoveLeft Unit:=wdCharacter, Count:=1
.TypeText Text:="\*lower \*Firstcap "
.Fields.Update
End With
' prepare for next loop
Selection.Collapse wdCollapseEnd
Loop
End With
ActiveWindow.View.ShowFieldCodes = False
End Sub
uppercase. When inserting a cross-reference the headings appear the same. I
would like to have the crossreference to be in sentence case. I followed
Graham Mayor's instructions from 6/29/2007 and created a Macro to globally
make the changes. However, I have a subsection and it now appears
capitalized. For example, the reference appears as SECTION 2(b) and when I
run the macro, it displays as Section 2(B) instead of Section 2(b). Any text
inside the parathensis should be ignored.
How can I fix this? Mr. Mayor's original macro code is below. Thanks.
Sub AddFirstCapSwitch()
ActiveWindow.View.ShowFieldCodes = True
With Selection.Find
.ClearFormatting
.Text = "^d REF"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = False
Do While .Execute
With Selection
.MoveRight Unit:=wdCharacter, Count:=1
.MoveLeft Unit:=wdCharacter, Count:=1
.TypeText Text:="\*lower \*Firstcap "
.Fields.Update
End With
' prepare for next loop
Selection.Collapse wdCollapseEnd
Loop
End With
ActiveWindow.View.ShowFieldCodes = False
End Sub