1 Attachment(s)
How to make outlook's Vb code as exe
I need to set the 20(same) Categories in 100 users's Outlook. Users don't want to manually create. Solution would be, running the exe on their machines , this VB code should be executed and set the Categories.
From Outlook Tools/Macro->Visual Basic Editor, if we paste the atached code(VB code) , then do F5, that will set the categories.
This code is saved as VbaProject.OTM under
C:\WINNT\Profiles\%USERPROFILE%\Application Data\Microsoft\Outlook
If I copy this file to some other users's Outlook directory, still the user has to go to VB editor and execute. Users do not want go to this editor
I am not sure, how to ake this code as exe, so it can run in users outlook.
if you have any suggestions to make this code as exe that would be great.
Thanks in advance,
Re: How to make outlook's Vb code as exe
Moved to the VB6 forum. The FAQ forum is for frequently asked questions.
Re: How to make outlook's Vb code as exe
You would need to place the code in a new vb6 project and then compile it into an EXE
Once that is done, you would need to create an installation and setup package which the users would need to run on their individual machines.
This would install the exe...once installed, the users would then have to run it.
It would seem to me to be less work to simply run it from the Outlook editor.
Re: How to make outlook's Vb code as exe
Thanks a lot for the reply. I made exe. I can run the exe on users machine. It sets the categories. I have one more question. I am setting the categories using array.
If objNameSpace.Categories.Count > 0 Then
For lngPosition = LBound(objCategoryNew) To UBound(objCategoryNew)
objNameSpace.Categories.Add (objCategoryNew(lngPosition))
Next lngPosition
End If
If the categories are already exist, it gives error msg as 'Duplicate category name'
The code first should check whether the category exist. If exist, it should not set it. can you please let me know which method I should use to check whether the element of the array alreay exist?
Thanks in advance,
Kavitha
Re: How to make outlook's Vb code as exe
It would be better to either use the Profile Wizard or to create a Outlook Add-In
Instead of assuming it doesnt exist and adding all 100 you should check for an items existance first before adding it.