How do I insert lower-case figure crossreferences?

K

kashmir_16

Hi!
When making a cross reference to a figure, how do I make word write the
"figure" with a lower case "f"?

Clarifying:
Now, when I insert the cross reference in a text it looks like:
"text...Figure 2.4...text", and I want it to be "text...figure 2.4...text".

But, of course, if the reference is the first word in the sentence it should
have an upper case F, as well as in the figure descriptions.

Thanks!
Nils
 
S

Stefan Blom

You will have to manually edit the relevant REF field codes, which Word uses
for cross-references, to include the \* lower switch. For example:

{ REF _Ref234034641 \h \* lower }

To display field codes, press Alt+F9. Edit the field codes. Press Alt+F9
again to hide field codes. Select the document and then press F9 to update
the fields.
 
K

kashmir_16

Thanks, this works.

I did see a different solution when \*lower \*Firstcap was added through a
macro, I was trying to implement this since I don't want to go through this
large document and change all field codes.

I guess the firstcap-command makes the first letter upper-case so it doesn't
fulfill my needs, but maybe I can edit the macro a little bit to make it
change the letters as I want it to?

If I want this macro to change the references that are not the first word in
a sentence to \*lowercase, how should I change it?

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
 
S

Stefan Blom

You had better ask in a programming newsgroup such as
microsoft.public.word.vba.general for assistance with the macro. It's beyond
my programming skills.
 
G

Graham Mayor

Adding a firstcap switch will not produce your original requirement of all
lower case? If you want all lower case you can do it with a macro. The
following should add \*Lower to all REF fields that contain the text _Ref
i.e. the cross references to the figures, wherever in the document they
appear..

Sub AddLowerToXRef()
Dim oSection As Section
Dim oStory As Range
Dim oHeader As HeaderFooter
Dim oFooter As HeaderFooter
Dim oField As Field
With ActiveDocument
For Each oStory In .StoryRanges
For Each oField In oStory.Fields
If oField.Type = wdFieldRef Then
If InStr(1, oField.Code, "_Ref") Then
oField.Code.InsertAfter "\*Lower"
oField.Update
End If
End If
Next oField
Next oStory
For Each oSection In .Sections
For Each oHeader In oSection.Headers
If oHeader.Exists Then
For Each oField In oHeader.Range.Fields
If oField.Type = wdFieldRef Then
If InStr(1, oField.Code, "_Ref") Then
oField.Code.InsertAfter "\*Lower"
oField.Update
End If
End If
Next oField
End If
Next oHeader
For Each oFooter In oSection.Footers
If oFooter.Exists Then
For Each oField In oFooter.Range.Fields
If oField.Type = wdFieldRef Then
If InStr(1, oField.Code, "_Ref") Then
oField.Code.InsertAfter "\*Lower"
oField.Update
End If
End If
Next oField
End If
Next oFooter
Next oSection
End With
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top