Quantcast
Channel: Word for Developers forum
Viewing all articles
Browse latest Browse all 4350

Find and Replace field codes without ruining cross-references

$
0
0

I'm trying to write a macro to replace a colon with a period when the colon appears directly after a field code. But I need any cross-references to the field to be maintained. I.e., I want to change:

Figure { SEQ Figure \* ARABIC }:
to
Figure { SEQ Figure \* ARABIC }.

without breaking the cross-references to the figure number.

I tried finding "^21:" and replacing with "^&##" (so I could then replace ":##" with ".", similar to a solution that was recommended for a similar problem), but the replacement ruined the cross-reference. The cross-ref now appears as "Figure " rather than "Figure 1". 

Also, I only want to do the replacement in paragraphs of style Caption.

Thanks for your help.


Viewing all articles
Browse latest Browse all 4350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>