• Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    Author
    Topic
    #364823

    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

    Viewing 0 reply threads
    Author
    Replies
    • #561330

      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.

      • #561351

        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?

        • #561355

          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…

          • #561357

            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

            • #561498

              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. smile
              (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…..

            • #561585

              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

            • #561760

              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.)

            • #562044

              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

            • #562052

              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

            • #562199

              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…

            • #562261

              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

            • #562423

              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

            • #562547

              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 http://www.thawte.com, if you’re interested…

    Viewing 0 reply threads
    Reply To: Reply #562044 in Distribute a VBA Module for Outlook (VBA/Outlook2Ksr1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel