macro to unlink selected crossref fields by their text content

A

adgorn

I have a document that needs to be customized for each client engagement. It
has numerous bookmarks that are linked (cross referenced) to other locations
w/i the document that need to reflect the same term as in the bookmark. So
for a new client, I go in, change the text in the bookmark and f9 to update
all the REF fields linked to that bookmark. I do this one bookmark at a time
over a period of days, as we get additional info from the client. I would
like to be able to unlink those fields related to the last bookmark I just
changed (leaving all the other fields still awaiting updating). In this way,
the document gradually becomes hardcoded over time. Make sense?
I can use the text in the bookmark to identify each instance of the
appropriate fields that I would like to unlink. So what I'd really like is a
place to enter this text string, then be able to click a button and cycle
through the entire document performing the unlinking one by one until there
are no more of those crossreference fields left.
 
J

Jezebel

Do the update, then display field codes and use Find to get all the fields
that refer to your bookmark: { REF BookmarkName } -- iterate those and
unlink them. You might find it easier to use document properties and
DocProperty fields - they tend to be more robust than bookmarks, and there's
no risk of scrambling your document as there is when you update the original
bookmark range.

But if you are unlinking your fields when you get live data, why bother with
fields at all? You could simply insert some dummy text for each value to be
provided, and use Find and Replace when you get the real values. Fields are
only worthwhile when the document content is dynamic, which seems not to be
the case with your documents.
 

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