Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Br. Columbia, Canada
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    AutoExec (Word 2003)

    I have a .dot file stored in Word's startup directory which contains a module with a sub called AutoExec which will not run automatically. Has there been a change in Word so that .dot files in the startup directory are not loaded when Word starts?

  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: AutoExec (Word 2003)

    If AutoExec were not longer executed, it would break so many applications it wouldn't be funny. On the other hand, the move toward having to "sign" projects could be affecting global add-ins. Couple things to check:

    1. <LI>When you start up Word, are there any command line switches (such as /a or /m) that could be interfering with its normal behavior?

      <LI>Are you trusting all installed add-ins and template? In Word 2002, this setting is under Tools>Macro>Security>Trusted Sources (tab). Does this make any difference?
    Hope this helps. Please let us know for future reference..

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,548
    Thanks
    3
    Thanked 149 Times in 142 Posts

    Re: AutoExec (Word 2003)

    I don't have Word 2003 but could it be a naming conflict with another AutoExec macro somewhere? The online help for Word 2002 has this to say...

    In the case of a naming conflict (multiple auto macros with the same name), Word runs the auto macro stored in the closest context. For example, if you create an AutoClose macro in a document and the attached template, only the auto macro stored in the document will execute. If you create an AutoNew macro in the normal template, the macro will run if a macro named AutoNew doesn't exist in the document or the attached template.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    Star Lounger
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Br. Columbia, Canada
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003)

    jsher and Andrew - thanks so much but still no joy. To avoid command line switches, I tried running Word from Word.exe in Windows Explorer with same result. Under Tools>Macro>Security>Trusted Publishers (tab) I have "Trust all installed addins and templates" checked ON. There is no other .dot file in Cocuments and Settings<username>Application DataMicrosoftWordSTARTUP, and no other addins. Normal.dot has no code in it. <img src=/S/bash.gif border=0 alt=bash width=35 height=39> Arrrrggh

  5. #5
    Star Lounger
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Br. Columbia, Canada
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003)

    I tried putting an AutoExec() sub in Normal.dot and it also did not execute. I tried an AutoNew sub and, grrrrrr, it worked - but I need an AutoExec sub because I want to do something everytime Word opens for every document. I set my macro security from High to Medium - no joy. <sigh> <img src=/S/disappointed.gif border=0 alt=disappointed width=15 height=15> What am I doing wrong?

  6. #6
    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: AutoExec (Word 2003)

    Is the template loading at all? Cross-check the Startup path under Tools>Options>File Locations to make sure it isn't pointed somewhere funny. I searched Google web and Google groups and didn't see any other reports of this, but the program's still just out so... stay tuned.

  7. #7
    Star Lounger
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Br. Columbia, Canada
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003)

    I checked the Startup path - its correct. I put the AutoExec() in normal.dot which is sitting in the .../Templates folder and definitely loading. The *only* thing normal.dot has in it is the AutoExec() , <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15> but it still won't run.

  8. #8
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,548
    Thanks
    3
    Thanked 149 Times in 142 Posts

    Re: AutoExec (Word 2003)

    What happens if you try changing the name of the macro in Normal.dot to 'AutoOpen'. That is the one I use if I want to hit every file on opening.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  9. #9
    Star Lounger
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Br. Columbia, Canada
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003)

    When I put an AutoOpen() sub in normal.dot, it runs whenever I open an existing document, but does not run for new document. I guess this is what you expected?

  10. #10
    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: AutoExec (Word 2003)

    If you use AutoNew, to trigger when a new document is created, and AutoOpen, to trigger when a document is opened (this can't be in a global template), do you really need AutoExec, which runs only when Word starts up?

  11. #11
    Star Lounger
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Br. Columbia, Canada
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003)

    Hi jscher - Yes I need Autoexec because the idea is to create a global addin which, if loaded, will create a button that, when clicked, will run what we call our "namestamp" macro - just a simple little macro that puts the path and name of the document in the bottom left corner of the document. Then we'll package it (I like your method of doing this which you explained in your "Deploying Word 2000 Templates " post) and put it on our web site and do a marketing campaign featuring it as a free gizmo. I thought it was going to be easy - sheesh! <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23> .

  12. #12
    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: AutoExec (Word 2003)

    Well, it certainly sounds as though something has changed in Word 2003 that no one's talking about. An alternative method of deployment is a COM Add-in, which can be configured to auto-run certain code at load time. (Or should I say, at least in Word 2000 and Word 2002, it can.)

  13. #13
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003)

    Gwenda,

    I use a slightly different approach and that works fine on all versions of Word from 97 up.
    - Create a module with the name AutoExec
    - In that module create a Public Sub Main() which contains all the code you want to run at Word startup.

    Regards,
    Jan

  14. #14
    Star Lounger
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Br. Columbia, Canada
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003)

    Jan - It didn't work in Word 2003 but worked fine on an earlier version of Word. <img src=/S/confused.gif border=0 alt=confused width=15 height=20> Thanks anyway.

  15. #15
    Star Lounger
    Join Date
    Feb 2001
    Location
    Vancouver, BC, Br. Columbia, Canada
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003)

    I own a copy of VB6. Do you think a VBA programmer like me could learn to write a COM addin in a reasonable length of time?

Page 1 of 2 12 LastLast

Posting Permissions

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