View Single Post
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 171
Default Use DocVariable field to initiative numbering?

Tom,

I don't see how what a DocVariable has to do with numbering figures.
You want to find "XYZ" and replace with a numbered figure caption
number correct? Try:

Sub ScratchMacro()
Dim myRange As Range
Set myRange = ActiveDocument.Range
With myRange.Find
.Text = "XYZ"
.MatchWholeWord = True
While .Execute
myRange.Delete
myRange.InsertCaption Label:="Figure"
Wend
End With
End Sub


Tom wrote:
Can the DocVariable field be used to somehow initiate Figure numbering?

Let me explain. Suppose I have the phrase XYZ in a document. I want to
integrate a macro such that each place XYZ appears, a Figure number is
inserted instead. In other words, the macro would say, Find XYZ, and
replace with the caption field.

Is this possible? If so, it might enable me to run a macro to fix a
RoboHelp output to include Figure captions.