View Single Post
  #16   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Tom Tom is offline
external usenet poster
 
Posts: 61
Default Use DocVariable field to initiative numbering?

Peter, let me provide a better picture of what I want my document to
look like. Here is the gist of it:

Blah blah blah blah blah blah blah. See Figure 1.

[image]
Figure 1. Image caption

blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah. See
Figure 2.

[image]
Figure 2. Image caption

blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah. See Figure 3.

[image]
Figure 3. Image caption

The Figure numbering does not start over (in other words, there is only
one Figure 1 in the entire document). Thanks to the earlier code you
guys posted on automating captions, the captions part works great. The
only part that remains is the "See Figure 1" reference that precedes
the caption.

It becomes slightly more complicated because in my RoboHelp source
file, I may have 200 topics and only choose to compile 150 of them
(depending on the needs of the audience).

Here is what I think might work -- I will label each "See Figure 1",
"See Figure 2" and so on as "See FigureZ." (All the same.)

Then here's what I want the code to do:

Look for first instance of the word "See FigureZ" and change it to See
Figure 1. Stop. Now look for the first instance of "See FigureZ" and
change it to See Figure 2. Stop. Now look for the first instance of
"See FigureZ" and change it to See Figure 3. Stop. Now look for the
first instance of "See FigureZ" and change it to Figure 4. Repeat until
100 Figure replacements or so.

I figure that after the first command changes the See FigureZ to Figure
1, then upon second looping, the first FigureZ instance that appears
will be placed exactly where Figure 2 should appear.

Can any of you write a macro that does this? I would so appreciate it.
Or do you have a better solution? Thanks so much for your help on
this. This seems like the last piece to the puzzle.