Results 1 to 14 of 14
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Chicago, Illinois, USA
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    Happy New Year all.

    I have a VBA module (called SendFile) in Outlook. Previously, I've used the Profile Wizard (part of the office resource kit) to distribute my Outlook customizations, because our users were new to Outlook and updating their profiles was not a significant inconvenience. Now, however, I need to add this SendFile module to their currently existing VBA code, and I'd prefer not to do it by updating their profiles, which resets any Outlook window customization they've done.

    I'm wondering if anyone has any thoughts on this, on any experience distributing VBA modules through, say, a login script. Any thoughts would be appreciated. Thanks in advance...

    klyjen

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    Well, I'm not sure how Outlook handles "global" templates (code bearing modules - CBM*). In Word we avoid the hassle of updating users CBMs (the Normal.dot) by keeping all code in a global template on a LAN shared folder, which executes whenever Word is started.

    Can you configure Outlook to look for such a thing as a global CBM?

    *The term is my invention and is not officially recognized nomenclature.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Chicago, Illinois, USA
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    Well, all Outlook application code is stored in a file called vbaproject.otm. My concern, I guess, is that I'm not sure what *else* is stored in this file, and I'm afraid that if I simply replace it for all of my users, it will have a similar outcome as if I'd used the profile wizard utility.

    So that, I guess, should be my real question--does anyone know what else is stored in that file? And, is it at all different between premium and professional?

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    My idea is to see if Outlook can use *another* otm file without disabling the vbaproject.otm.

    Word allows lots of CBMs (how many I have no idea). Maybe Outlook is built the same way. Leave the individual's vbaproject.otm alone and simply tell Outlook to use your global otm as well.

    My guess is you need to create an Add-in module and activate it with a system or user policy (or just have the users activate it).

    I am currently completely ignorant of the means whereby an Outlook Add-in module is created. Hang in there, maybe somebody else here knows...
    Attached Images Attached Images
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Chicago, Illinois, USA
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    Thanks!

    As far as my understanding goes, Outlook is very different from Word in that regard; you can only have one "place" for all of your code. Everything goes into the same file. I have a vague understanding of com addins (I posted this on the Outlook board too, and got a response to that effect there), but not enough of an understanding to be comfortable with it. As for having anything that users need to activate...won't happen. For "firm culture" reasons, I need to activate this centrally for all users, whether that's through a login script or something else, I don't know...

    Oh, and I like "cbm". It makes sense. Which is probably why it will never be adopted...*g*

    Jen

  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: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    I have done all 3:

    (1) Supplied vbaproject.otm to users who didn't have one or had a blank one.
    (2) Supplied exported .bas and .frm files for import by users (or, more commonly, by me visiting their computers).
    (3) Created a COM Add-in using Office 2000 Developer and a setup.exe routine using the Package and Deploy Wizard.

    Thoughts:

    (1) is the most automatic, but as you point out, it's a one shot deal.
    (2) is hard to automate, but you could create a start-up macro to check a network folder for new files to import. That would be slick. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    (3) is relatively easy to deploy (run setup.exe), but debugging is a lot harder because the code is encapsulated in a DLL.

    For either 1 or 2, the users will get macro security warnings, so there are also some training issues.....

  7. #7
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Chicago, Illinois, USA
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    Thanks...it occurs to me (thanks to a post in the Outlook forum) that I can't simply supply a new vbaproject.otm to my users, because I also need to give them a toolbar button to activate the SendFile feature.

    How does (2) work, if you don't mind my asking? I'm not familiar with .bas files (I'm ashamed to say). There are no forms associated with this particular module, so I don't need .frm files, but I don't know what is "contained" with a .bas file. Will it include the toolbar button? If not, is (3) easy to set up? It's a small amount of code, and only one button, but I'm beginning to think that's what I should learn, if it will/can include both the the functionality and the button.

    Thanks...

    Jen

  8. #8
    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: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    I have only created .bas files by exporting a module from inside the VBA editor. It contains just code and some module properties. There were some threads earlier this year about writing code that would add a custom button at run time. I think someone even coded a way to see if the button already existed before adding it. (Or maybe it was a menu item; same basic idea.) However, life would be easier if it was just created at install time.

    Incidentally, toolbar info is stored in a different file, outcmd.dat I believe. (If you search that file name on the Outlook board, you can find out what else it stores; people frequently recommend deleting it when Outlook starts behaving strangely.)

  9. #9
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Chicago, Illinois, USA
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    Thanks...I will check it out and see if perhaps I can distribute a correct copy of the toolbar info file with an updated copy of the .otm file--perhaps the two together will be enough. I'll let you know! (I actually had a thought about that over the weekend, that there must be a file that contains toolbar info--so I'm especially glad to know what it's called.)

    klyjen

  10. #10
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Chicago, Illinois, USA
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    HA! It looks like copying the outcmd.dat file and distributing it with the vbaproject.otm file (via login script) is going to work! No profile wizard to mess up an individual's view settings, and all appears to be good.

    This is cool. Thanks...

    Jennifer

  11. #11
    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: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    But you might blow away the user's "Outlook bar" as part of the process, if that is stored in outcmd.dat. Please check that out...

  12. #12
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Chicago, Illinois, USA
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    Ahh....I'll add that to the list of things my testers are watching for. I sent the new files to two of my IS Personnel in regional offices to have them check it out; I'll let you know if the Outlook Bar is part of what is controlled by that file. Thanks for thinking of it...

    jen

  13. #13
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    Jenny,

    Another thing I'm curious about; when you deploy the code that way, will the users get a macro security message, the first time they try to run a macro per Outlook session?
    (- that's the experience I had from my one foray into this; I'd be glad if there were a way to do this without triggering the macro warning, but without having to go the .com add-in route)

    Gary

  14. #14
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Chicago, Illinois, USA
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    Not sure yet, as I haven't seen the results. My 'testers' are swamped, so this is farther down on their list of projects. But when I find out, I'll let you know.

    Re: macro warnings in general, though--my code is signed with a digital signature called "firmIS" and our users are instructed to check the 'trust macros from [this] source' box on the macro warning (the warning is different for signed macros. That way, I can continue to add additional modules to the same project, and users don't get prompted. I got the certificate from www.thawte.com, if you're interested...

Posting Permissions

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