![]() |
#1
|
|||
|
|||
![]()
I have a long document with conditional numbered paragraphs and am trying to include cross references to the conditional paragraph numbers as part of a userform that updates many documents. With my conditional paragraphs, the paragraph numbers are not "visible" until the fields are updated and unlinked. So, when you enter the cross references in the conditional paragraphs, the cross reference dialog box to choose which sections to reference looks like this:
Article I. Article II. 2.1 2.2 Article I. (this is conditional)---- (after unlinking it will become Article III.) 1.1 (this is conditional) --- (after unlinking it will become section 3.1) 1.1 (this is conditional) --- (after unlinking it will become section 3.2) Article III. --- (after unlinking, this will be updated to Article IV.) However, when I update and unlink, the cross references within the conditional Article I, or the sections 1.1, for example, do not update - they retain the original 1.1 (or Article I.) of the conditional text. I then tried to update all fields other than REF fields within my userform with the following VBA code: ActiveDocument.Fields.Update Dim oField as Field For each oField in ActiveDocument.Fields If oField.Type <> wdFieldRef Then ActiveDocument.Fields.Unlink I thought this would unlink everything other than the REF fields - leaving the REF fields in place - and then I could update them again once all of the paragraphs were no longer conditional (since they would be unlinked). However, it still updated ALL fields, including the REF fields of the cross references so I had no fields left in my document (other than the heading/paragraph numbers and page numbers) - all REF fields were now regular text. Note also that normally the REF fields show up in the bookmarks dialog box. But, since these are conditional, my bookmark dialog shows no bookmarks; however, when I edit a REF field, the bookmark name correctly shows up in the edit REF field dialog. Can anyone help with this issue? Thanks. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cross reference is bad. | Leffken | Word | 1 | 06-09-2016 03:12 PM |
![]() |
lonniepoet | Excel Programming | 1 | 06-09-2016 09:54 AM |
![]() |
mktate | Word VBA | 5 | 03-13-2016 02:07 PM |
![]() |
wmac | Word | 1 | 05-14-2013 08:54 PM |
manipulating cross-reference fields | _wim_ | Word | 0 | 12-10-2010 05:52 AM |