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 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?