Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Sydney, Australia
    Thanked 0 Times in 0 Posts

    How to modify Table of Contents macro (97, 2000)

    I would like to have my Table of Contents with the page number first on each line, then the heading name after that.

    Macro viruses became a possibility when word commands like File->Save became macros that users could modify and save in documents, so I think there must be a way I can modify the macro that inserts a TOC (InsertTableofContents), but the Edit key is greyed out, and Step Into that usually opens the VBA editor to step through the macro, runs it full-speed instead.

    Any ideas?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 93 Times in 89 Posts

    Re: How to modify Table of Contents macro (97, 2000)

    You can't actually step through built-in commands, but you can replace them with macros of your own by giving a macro the same name (e.g., FileSave or InsertTableOfContents). However, this doesn't help you...

    If you can imagine doing this manually, you can program it as a macro:

    (1) Insert "normal" table of contents.
    (2) Convert table to static text (by converting the field to text, Ctrl-Shift-F9).
    Then for each entry in the table:
    (3) Cut the page number, which is the last "word" in the "paragraph," to the clipboard.
    (4) Remove any tabs from the end of the paragraph.
    (5) Paste the page number at the beginning of the paragraph and insert appropriate punctuation (space, tab, whatever you want).

    Is that the idea?

Posting Permissions

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