Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    Dec 2004
    Location
    Chicago, Illinois, USA
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Updating sub-doc fields but not sub-doc itself (Word 2003)

    Here I am again, humbly asking advice on what appears to me as a sticky problem. My question today is how to update SEQ fields in an included document without refreshing the full included document.

    Background: my main document uses an INCLUDETEXT field to bring in the contents of a sub-document. The sub-document contains a procedure whose steps are numbered via SEQ fields. Some paragraphs in the sub-doc are marked with a style called UG Only. The idea is that when the sub-doc is included in the user's guide, all steps are used; but when included in the Getting Started document, I search for and delete all text marked UG Only.

    With me so far? The problem is that, in the sub-doc, some of the paragraphs marked with the UG Only style are procedure steps with SEQ fields. Suppose that step 3 is marked UG Only -- I want it to appear in the user's guide but not in Getting Started. When I'm generating the Getting Started doc, I use find/replace to delete all UG Only text. So I'm left with a procedure whose steps are numbered 1, 2, 4. So far so good, but now I want Word to re-number the sequence in some automated way. The only way I can think of to do that is to select the included sub-doc and press F9. Unfortunately, that updates the INCLUDETEXT field rather than the included SEQs, causing the previously-deleted step 3 to re-appear.

    So the question is this: is there another way to tell Word to refresh the values of the fields in the sub-doc without refreshing the sub-doc itself? I want to keep step 3 in the sub-doc, since it still applies when included in the user guide. I hope I don't have to maintain separate versions of the sub-doc, or have one sub-doc containing steps 1 & 2 and another containing step 4, but I can't think of any other way to do it. Anybody have any ideas? Thanks so much (I really appreciate all the advice I've received in this forum), and happy holidays to those of you celebrating them this week.

    Bruce Watson

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Updating sub-doc fields but not sub-doc itself (Word 2003)

    I tried a short macro that included a loop...
    <code>
    For Each fldNext In ActiveDocument.Fields
    If fldNext.Type = wdFieldSequence Then fldNext.Update
    Next fldNext
    </code>
    but as soon as it updated a single Sequence field it also updated the entire IncludeText field, I have no idea why.

    I then tried <code>.Unlink</code> on the IncludeText field, but this also unlinked all the SEQ fields! This is going to be hard!

    StuartR

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Updating sub-doc fields but not sub-doc itself (Word 2003)

    If it's a matter of changing the document temporarily to print the Getting Started guide, you can do it as follows:
    - Open the main doc.
    - Open the subdoc in a separate window.
    - Delete the UG paragraphs in the subdoc.
    - Switch to the main doc window.
    - Click anywhere in the subdoc.
    - Press F9 to update.
    - Print.
    - Close both windows without saving.
    If you want a permanent version of the Getting Started guide, you'll need a separate version of the subdoc. I don't see a way around that. You can write a macro to generate the Getting Started version of the subdoc from the complete version.

  4. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,805
    Thanks
    4
    Thanked 235 Times in 217 Posts

    Re: Updating sub-doc fields but not sub-doc itself

    Single sourcing with Word has a few problems and this is one of them. Since you are doing a delete activity anyway then why don't you just use a middle man to do your dirty work.
    1. Update and maintain the UG master as per normal
    2. Duplicate the UG called 'UG for GSG', do the search and destroy to kill off the unwanted styles and then update the fields
    3. Modify the links in the GSG to point at the 'UG for GSG' file

    Next time you make changes to the UG and want the changes reflected in the GSG then you repeat step 2 (overwriting the existing one) and then update the links in the GSG.

    Note: there is no link between UG and the UG for GSG. The UG for GSG should be replaced everytime you want the GSG rebuilt. This can be easily achieved with a simple macro to automate step 2.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  5. #5
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Cherrybrook, New South Wales, Australia
    Posts
    116
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Updating sub-doc fields but not sub-doc itself (Word 2003)

    Hi,
    I'd like to suggest a differenct approach: Instead of deleting all the text that is in the style UG Only, redefine the style to be hidden. You can then save the sub-document. You won't have lost any text, only hidden it.
    This leaves the problem of the sequence numbers. I'd approach this with a macro that converts the sequence number switch n to c if it is in the UG Only Style (this prevents it from incrementing) (or use search and replace)
    When you need the sub-document for the user guide, redefine the style to not hidden, convert the seq switches back to n and all will be well again.
    Regards,
    Judith

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating sub-doc fields but not sub-doc itself

    Hi Judith:
    That's an interesting approach. I tried it, but maybe I don't understand your last step correctly. If, in the target document, I replace the {SEQ A n } fields with {SEQ A c} fields for the UG style, the numbers will not change until the SEQ field is updated. As soon, as I try to update the SEQ field, the entire Includetext field updates (which changes the switch in the SEQ field & changes the style UG back to unhidden). Am I missing one of your steps?

  7. #7
    New Lounger
    Join Date
    Dec 2004
    Location
    Chicago, Illinois, USA
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating sub-doc fields but not sub-doc itself

    Phil -- I think she meant that you'd change the SEQ fields in the sub-doc, then get the SEQs to update and save the sub-doc. Then you'd generate the Getting Started doc. When it's done, you'd go back and restore the sub-doc (un-hiding & resetting the switches) and re-save the sub-doc. Does that sound right, Judith?

    Bruce Watson

  8. #8
    New Lounger
    Join Date
    Dec 2004
    Location
    Chicago, Illinois, USA
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating sub-doc fields but not sub-doc itself

    All -- thanks for the great ideas. Judith's solution is indeed interesting and clever, but I'm probably going to go with some form of Hans' idea. Thanks again, though, to all of you.

    Bruce Watson

  9. #9
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating sub-doc fields but not sub-doc itself

    Thanks for the explanation, Bruce. I don't use the Master Doc/SubDoc feature, so I'm somewhat unfamiliar with it. If you plan to stick with that feature, you should read Why Master Documents Corrupt.
    Cheers,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •