modifying all TC field codes to decrease their outline level

C

Chip Orange

We have a need to take a document full of TC field codes, and with an
autoopen macro, have them all decrease their outline level indication (so
that a level one TC field becomes level 2, etc.).

Does anyone know of an example or easy way to do this (other than the
obvious one of writing a macro to process all fields in the doc, looking for
TC field codes, parsing out the level indication, modifying it, recreating
the field, etc.).

Thanks.

Chip
 
J

Jezebel

You can do it using Find and Replace instructions. Try this manually until
you're comfortable with what's going on, then code it as your macro --

1. Dispay hidden text and field codes, so the TC fields are visible.

2. For each TC level, starting with the highest that might be used in the
document and working backwards (eg 4, then 3, 2, 1) --

-- use Find and Replace with 'Use wildcards' checked

-- search for: (TC*\\l @)4 (open-bracket TC asterisk slash slash
ell space @ close-bracket level-number)
-- replace with: \15 (slash one level-number-plus-one)


You could put this into a loop --

For pIndex = 5 to 1 step -1

pSearch = "(TC*\\l @)" & pIndex
pReplace = "\1" & pIndex + 1

....

Next
 
C

Chip Orange

Thanks very much; just the kind of idea that I was thinking would be out
here somewhere. I need to study up a bit on the search/replace syntax to
understand this, but the idea of it in a loop seems a whole lot more
reliable than my trying to parse each field code myself.

Thanks again.

Chip
 

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