B
bha281
I would like to create a macro that will: (1) place a LISTNUM field at
the insertion point; (2) move the insertion point to the end of the
document; and (3) insert a cross-reference to the page number of the
LISTNUM field created in step one. Steps 1 and 2 I've already figured
out after some trial and error with recording macros, but I don't know
what I need to do to make step 3 work.
Sub Crosslist()
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:= _
"LISTNUM ", PreserveFormatting:=False
Selection.EndKey Unit:=wdStory
Selection.TypeText Text:="Here's where I get stuck."
End Sub
Any advice (or indications that this is an exercise in futility) would
be appreciated.
the insertion point; (2) move the insertion point to the end of the
document; and (3) insert a cross-reference to the page number of the
LISTNUM field created in step one. Steps 1 and 2 I've already figured
out after some trial and error with recording macros, but I don't know
what I need to do to make step 3 work.
Sub Crosslist()
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:= _
"LISTNUM ", PreserveFormatting:=False
Selection.EndKey Unit:=wdStory
Selection.TypeText Text:="Here's where I get stuck."
End Sub
Any advice (or indications that this is an exercise in futility) would
be appreciated.