Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Autocorrect entries + Update TOC (Word 97/2000/2003)

    Hi

    I have two separate question. Hopefully, you people will provide some feedback.

    1. Autocorrect entries - I understand these are stored in Normal.dot file. Can they be stored in another template not Normal.dot. We have our own template and I would like to store the autocorrect entries in our private template.

    2. TOC Update - This is really bizzare & it seems to affect Word2003 than anything else. In my template, I update the TOC when the document is closed. The problem is as follows:

    Word97/2000 - ActiveDocument.TablesOfContents(1).Update - works perfectly - no problems
    WORD2003 - ActiveDocument.TablesOfContents(1).Update - it paginates FOREVER until escape is pressed. Why doesn't it work?

    so I did the following (trial & error method by recording a macro in WORD2003 to update the TOC) & guess what I recorded:

    Word2003 - Update TOC macros - WordBasic.UpdateTableOfContents ( <img src=/S/bash.gif border=0 alt=bash width=35 height=39>). Why the difference? But it works & updates TOC fine in WORD 2003. (!!!!!).
    But under Word2000 it comes up with the error 438 "Object doesn't support method or property". I just don't understand it.

    Word2003 has given lots of headache especially updating of the TOC.

    Any help greatly appreciated. Thanks in advance.

    Robie.
    Thanks.
    Robie

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

    Re: Autocorrect entries + Update TOC (Word 97/2000/2003)

    1) Yes. AutoText entries can be stored in any template. You must either open the template or a document based on the template. You can then select the template in the Insert | AutoText | AutoText dialog.

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autocorrect entries + Update TOC (Word 97/2000/2003)

    Hans

    Thanks for the reply. That is exactly what I did. I opened my template (not document) and added the autotext entries. My template is based on Normal.dot. When I open Normal.dot and look at the autocorrect entries - they are all there. Is these a way of specifying which template to use. Can't see a way of specifying which template the autocorrect entries are stored under. Perhaps I am just being dumb.

    Thanks.
    Thanks.
    Robie

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

    Re: Autocorrect entries + Update TOC (Word 97/2000/2003)

    Sorry, my mistake - my previous reply is about AutoText, not about AutoCorrect.

    AutoCorrect entries are stored in two places:
    - Unformatted entries are stored in files with extension .acl, for example MSO2057.acl (2057 is the language code for UK English).
    - Formatted entries are stored in Normal.dot, not in other templates.

    See How can I import and export all my AutoCorrect entries, so they can be transferred to another machine?

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Autocorrect entries + Update TOC (Word 97/2000

    I seldom generates TOCs. However, they are just another field code, so you could try a different approach and see whether it helps. The following is untested "air code"; the properties and methods may be a bit different, and there might be a better comparison option using Type.

    dim fld as word.field
    for each fld in activedocument.fields
    if instr(1, fld.code, "TOC") then
    fld.update
    exit for
    end if
    next

  6. #6
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts

    Re: Autocorrect entries + Update TOC (Word 97/2000/2003)

    You haven't named a macro the same as one of Word's commands....? For example, if you have a macro named UpdateFields that runs the WordBasic command, any macro that uses the UpdateFields feature will run your macro, not the Word feature. I've done that and usually rend my garments until I realize it (several garments later).

    When I recorded updating the Table of Contents I did not get a WordBasic command. I got

    <pre>Selection.Fields.Update</pre>



    And your original code works for me:

    <pre>ActiveDocument.TablesOfContents(1).Update</pre>


    No looping. You could try...

    <pre>For Each toc in ActiveDocument.TablesOfContents
    toc.Update ' -or- .UpdatePageNumbers
    Next toc</pre>


    But if the first doesn't work, this one probably won't either. Is it possible there's something off in your environment?

    Just a thought, <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Kim

  7. #7
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autocorrect entries + Update TOC (Word 97/2000/2003)

    Thanks for your comments. Sorry for the late reply but I have been away from the office. Few things for me to try out.

    Thanks once again.

    Robie
    Thanks.
    Robie

Posting Permissions

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