Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28
  1. #16
    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)

    Yes, if I can do it, you can do it. It tooke me many hours to puzzle out how to use the convenient "designers" (like forms, their code is in a hidden code pane; right-click them in the Project Explorer and and View Code) and to set up event handlers, if needed, but the guts of the project are identical. Creating installers is a bit messy with the Packaging Wizard, but it's the only thing I've used. There have been past posts here on recommendations for others (e.g., Wise, Installshield, etc.).

    I found the online help on MSDN a bit sparse. The book "Office 2000 Visual Basic for Applications Fundamentals" was somewhat helpful. Mostly it was trial and error, and a few questions here in the Lounge. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    By the way, I used Office Developer edition. There probably are some differences in the more general purpose VB editor in how you start up the project in the first place. MSDN probably covers that.

  2. #17
    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)

    Thank you for your words of encouragement. <img src=/S/rose.gif border=0 alt=rose width=15 height=15> Do you think that if I write a COM Addin, it is going to be really easy for the end user to install it? That is my chief concern - what if I go through the COM learning curve only to find that it's still hard to deploy? I have a copy of Office developer edition i think. Thanks for reminding me that I can use it instead of VB. That would be more a more familiar environment than VB6. I'm somewhat disappointed to be going BACKWARDS as I was hoping to work in 2003 and use .NET, but what I read about creating a COM AddIn with .NET on MSDN was truly scary. <img src=/S/spook.gif border=0 alt=spook width=15 height=15>

  3. #18
    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)

    Deployment of a COM Add-in is via a setup.exe file, so it's a no-brainer for the user. At least, in an ideal world. I had problems with my Outlook 2000/Windows 2000 add-in not working in Outlook 2002/Windows XP for no apparent reason. Something about different references, I guess, but I just recompiled on the new platform rather than trying to figure it out.

  4. #19
    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)

    Well that's it then -- there's no option but to, gulp, learn to do a COM add-in. I would cross my fingers <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16> but its too hard to type like that.

    I'm glad your Outlook 2002/Windows XP recompile was backwardly compatible.

  5. #20
    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)

    (Edited by HansV to correct typo in first path and to generalize second path)

    > Jan - It didn't work in Word 2003 but worked fine on an earlier version of Word.

    I use Windows XP Pro and Office 2003, both Dutch versions, and my solution works fine on my PC.
    I did a little testing and found out that there are 2 Startup directories:
    1. C:Program FilesMicrosoft Office 2003OFFICE11STARTUP
    2. Cocuments and Settings<logon name>Application DataMicrosoftWordSTARTUP

    If the add-in containing module AutoExec with Sub Main is placed in 1 (and Options | File locations is pointing to it) then all works fine, no questions asked. This is the path I actually use. But if I place the add-in in 2 and change Options | File locations to that directory, I get a dialog panel asking if I want the macro's to run or not. Macro security is normally set to Average on my PC. And if I place the add-in in 1 and Options | File locations points to 2, then I also get the macro security dialog panel. And after granting permission, the code in Sub Main runs...!

    So if your add-in is located in 2, you can give relocating it to 1 a try.

    Good luck
    Jan

  6. #21
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003)

    ...but see also this post .

    I essayed with Utils.DLL a couple of years ago, but ultimately came back to Utils.dot for all my Word97SR2/VBA applications.

    My main problem was with the installation of an upgraded DLL. The Word applications seemed to drop the reference and not pick up the new reference. Since most of my aps go out locked (so the user can mess up the code more than I have), I could find no easy way of resetting the reference to the new DLL.

    I'm back distributing Utils.DOT with my applications.

    If you solve the reference problem, please let me know. A utils.DLL would be of use to me in my VB6 projects.

  7. #22
    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 - I moved the .dot file to C:Program FilesMicrosoft Office 2003OFFICE11STARTUP and then I used Options | File Locations | StartUp to change the StartUp directory to the same path. No joy. <img src=/S/bwaaah.gif border=0 alt=bwaaah width=123 height=15>

  8. #23
    Lounger
    Join Date
    Jan 2004
    Location
    Honolulu, Hawaii, USA
    Posts
    47
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003)

    Are you sure you have checked Tools, Macro, Security... If it is set High, either set it to Med or Low, or you can always Self-certify. And.. Check the Trusted Sources tab. Trust all Add-ins and templates should be checked. Sorry, havent read this whole thread, it seems to have gone wandering, but the problem is MS has progressively disabled all code since Office 97. We use Security level Med and have started self-certifying with "DeleteThisAndDie". In reality, abandon all hope. Every 18 months the rug is going to be pulled out from under you.

  9. #24
    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) - FIXED!

    Omigawd! <img src=/S/drop.gif border=0 alt=drop width=23 height=23> I came back after the weekend and the darn thing works! Could it be I just had to reboot? I swear nothing else has changed. The .dot file is in Cocuments and Settings[Username]Application DataMicrosoftWordSTARTUP, it has a module called "AutoExec" with a subroutine called "Main" and another called "AutoExit". They are both executing!

  10. #25
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003)

    s the sub Public?

  11. #26
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoExec (Word 2003) - FIXED!

    You do not want to use a module named AutoExec.

    Name the module, say, modAutoStuff and have a

    Public Sub AutoExec()

    in the module.

  12. #27
    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)

    Howard - It is just declared with "Sub", but Help says: "If not explicitly specified using Public, Private, or Friend, Sub procedures are public by default."

  13. #28
    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) - FIXED!

    Will you tell me why? It's working OK right now.

Page 2 of 2 FirstFirst 12

Posting Permissions

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