Distribute Outlook VBA

Hi experts,

     I am writing some vba code in Outlook and need a way to distribute this code to 6-7 users. Can u suggest me how i can do this?

Regards
Hitesh
LVL 13
Hitesh ManglaniAsked:
Who is Participating?
 
David LeeCommented:
Yes, I am certain that that's the only way to distribute VBA code.  COM addins do not use VBA.  They are written in Visual Basic or C.  You cannot create a COM addin in Outlook's VBA editor.  You'd have to have a full version of VB (e.g. VB6) or Visual Studio.  It may seem like a fine distinction, but your question asked about VBA and I didn't want to assume that you have access to a full-blown programming language.  If you do have access to VB, then "yes" you can accomplish the same affect by creating an addin.  In fact that's preferred.  It's also more complicated.  Addins are not as easy to write as a VBA macro.

Yes, if you create an addin, then the users cannot see the code.  
0
 
David LeeCommented:
Hi, hiteshgoldeneye.

The only way to distribute VBA code in Outlook is to distribute the file that Outlook stores all of it's code in.  That file is named VbaProject.OTM.  You will find it in the folder "C:\Documents and Settings\<username>\Application Data\Microsoft\Outlook".  Unfortunately, distributing code this way is a problem if any of the people you distribute it to already have any code in Outlook.  There can be only one Outlook code file, so you have to overwrite the existing code file.  That means that any code in the overwritten file is going to be lost.  Outlook has to be closed to overwrite the file, so the best time to do this is through a login script.
0
 
Hitesh ManglaniAuthor Commented:
Hi, thanks for your reply, but are you sure thats the only way coz i have had a look at this site
http://www.outlookcode.com/article.aspx?id=28 
which recommends using a COM addin regarding which i have no idea.

And can i keep the code secure, that is prevent the users from viewing it?
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
Hitesh ManglaniAuthor Commented:
So VBA code is not secure , right? Can i password protect it somehow?
Also do you have an idea on how i can create an add in in Visual Studio?
0
 
David LeeCommented:
"So VBA code is not secure , right?"
Correct.

"Can i password protect it somehow?"
No.  The closest you can come is to make the code file read-only and hope that the users don't know how to change that.

"Also do you have an idea on how i can create an add in in Visual Studio?"
There are templates available here: http://www.slovaktech.com/outlook_2007_templates.htm
0
 
Hitesh ManglaniAuthor Commented:
hi thanks again, could you provide me template for outlook 2003?
0
 
Hitesh ManglaniAuthor Commented:
Also can i capture outlook events like ItemAdd in the add in?
0
 
David LeeCommented:
The only template I know of for 2003 is one that's for VB6.  You can find it here: http://www.microeye.com/resources/code.htm  The page says Outlook 2000 and 2002, but it works for 2003 also.

Yes, you can capture the ItemAdd event in an add-in.
0
 
Hitesh ManglaniAuthor Commented:
it would be very helpful if you could provide me any link relevant to developing an outlook 2003 addin using C#, if possible.
0
 
David LeeCommented:
Sorry, I don't use C#, so I've never looked for a template using it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.