Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wrong AutoMacro firing during documents.add (2000)

    I've run into a weird behavior on some installations of Word 2000. The client claims it happens in SR1 and SP3, I can' t reproduce it in SP3, and certainly not in Word XP or 2003:

    The code executes
    documents.add Visible:=True
    which should create a new doc from Normal.dot.
    However, the Document_New event from the template that's running the macro is firing.
    This does not happen with a Ctrl-N or File > New or clicking the New Document button on the toolbar.

    Obviously, the cure is a "WordBasic.DisableAutoMacros True" around the code, but I'm still trying to figure out why this is happening.
    Has anyone else ever seen this? I'd like to squarely put the blame on Microsoft here. I can't find anything in the knowledge base to fit this.

    Thanks,
    Joel

  2. #2
    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: Wrong AutoMacro firing during documents.add (2

    Could it happen if the template that is running also is loaded as a global template? (I think so with AutoNew, but I'm not sure with Document_New)

  3. #3
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wrong AutoMacro firing during documents.add (2

    Nope. First thing I checked.

    I've been able to reproduce it by installing Word 2000 on a VMWare session, then loading my template, but it's definitely not loaded as a global or add-in.
    Can't get the same thing to happen at all on Word XP or 2003.
    Framing the statement with WordBasic.DisableAutoMacros certainly stopped the problem.

    So at least I can get around this... now if Microsoft would only fix copying styles, section breaks, list templates....

  4. #4
    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: Wrong AutoMacro firing during documents.add (2

    If you are explicit about the template in Documents.Add (i.e., Template:=NormalTemplate, if that is the correct parameter name), does Word 2000 do better?

  5. #5
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wrong AutoMacro firing during documents.add (2

    I should have mentioned that -- tried that too, still fired the Document_New
    It definitely happened on a machine running Word 2000 SR-1, haven't verified yet that it still happens in SP-3, although our trainer said it happened.

Posting Permissions

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