Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Nov 2002
    Location
    London, Gtr London, England
    Posts
    496
    Thanks
    8
    Thanked 0 Times in 0 Posts

    AutoNew was working and now doesn't (Word 2003)

    Dear Loungers,

    My template has an AutoNew procedure and has been running beautifully. But it just doesn't run now. A similar template continues to perform as expected. It is clear from debug statements that absolutely nothing is happening nor are any erros reported; but I can run it manually. Yes, I have amended the code but I didn't tough the AutoNew code. Can anyone suggest circumstances that might cause this? (have rebooted in cas ethere was a memory glitch but problem remains)

    thank you........... liz

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

    Re: AutoNew was working and now doesn't (Word 2003)

    Try using the Document_New event procedure in the ThisDocument module of the template instead of AutoNew in a standard module.

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

    Re: AutoNew was working and now doesn't (Word 2003

    I will try this. Is there any pros aor cons of using the "Autos" vs the "Document_s" aproach?

    liz

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

    Re: AutoNew was working and now doesn't (Word 2003

    The Document events in the ThisDocument are more "modern", so I tend to use them when I want to run code when the user creates a new document, opens a document or closes a document based on a specific template. (AutoNew etc. are from the time of WordBasic, in Word 95 and before; the Document events were introduced together with VBA in Word 97)

    There is still a use for AutoNew etc.: if you place a macro named AutoNew in a module in your default template Normal.dot, it will be run whenever the user creates a new document, whether it is based on Normal.dot or on another template. A Document_New event procedure in ThisDocument in Normal.dot is only run when you create a blank new document, not when you create a document based on another template.

    And there is no event equivalent for AutoExec. A macro of this name in Normal.dot is run each time Word is started.

Posting Permissions

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