K
kashmir_16
Hi!
I'm trying to convert my cross references (figures and tables) to lower case
by changing the field codes to \*lower. However, it should only change this
for the references that are in a sentence and not for the references that
starts the sentence.
Right now all the cross references start with an upper case letter
(<text...Figure 2.1...text>), but it should look like:
<text....figure 2.1....text>
and
<Figure 2.1....text>
I found this macro, it converts all the references to lower case, but how
can I change it so that it excludes the references that are the first words
in a sentence?
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"
.Fields.Update
End With
' prepare for next loop
Selection.Collapse wdCollapseEnd
Loop
End With
ActiveWindow.View.ShowFieldCodes = False
End Sub
Thanks
Nils
I'm trying to convert my cross references (figures and tables) to lower case
by changing the field codes to \*lower. However, it should only change this
for the references that are in a sentence and not for the references that
starts the sentence.
Right now all the cross references start with an upper case letter
(<text...Figure 2.1...text>), but it should look like:
<text....figure 2.1....text>
and
<Figure 2.1....text>
I found this macro, it converts all the references to lower case, but how
can I change it so that it excludes the references that are the first words
in a sentence?
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"
.Fields.Update
End With
' prepare for next loop
Selection.Collapse wdCollapseEnd
Loop
End With
ActiveWindow.View.ShowFieldCodes = False
End Sub
Thanks
Nils