Preventing user from creating new contacts in an outlook folder

Add-in Express™ Support Service
That's what is more important than anything else

Preventing user from creating new contacts in an outlook folder
Preventing user from creating new contacts in an outlook folder 
Jim Albert




Posts: 21
Joined: 2005-12-31
I have an addin that creates a folder for storing contacts in outlook. When the user selects this folder I do not want them to be able to modify any of the contacts or distribution lists in the folder. I do not want them to be able to create any new contacts or distribution lists in this folder also.

I have solved the problem of being able to modify the existing contacts by replacing the Explorer view using the ADX Extensions product. That has worked out fine.

The problem that I cannot figure out is how to keep the user from creating new contacts or distribution lists in the folder. The problem is that the Actions menu contains a create contact and create distribution list.

I know how to get the "New Inspector" and "Item Added" events, but I cannot see a way to esentially canel these events. What I would like to be able to do capture the "New Inspector Event" and if the folder matches my "read-only" folder I would like to display a message box that says you cannot add an item to this folder and then keep the inspector from opening. I cannot figure out how to keep the inspector from being displayed.

The other option that I have investigated is a way to disable the "Create Contact" menu and toolbar items when my "read-only" folder is selected, but I have not been able to figure out how to do this either.
Posted 28 Apr, 2006 09:44:13 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Jim.

I will try to develop an example on how you can prevent creating new contacts or distribution lists.
As to the issue with opening inspectors, try to show you dialog in the 'New Inspector' or 'InspectorActivate' event handlers and then close the inspector using the Close method of the Outlook._Inspector interface.
Posted 29 Apr, 2006 17:57:27 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Jim.

Unfortunately it is not possible to disable all "Create Contact" toolbar items in Outlook. E.g. you can't disable the 'New' button on the 'Standard' toolbar. So I decided to develop an example that shows on how you can prevent contacts and distribution lists from opening in a specified folder. You can download the example here:
http://www.add-in-express.com/projects/totalcontactsdisable.zip
Posted 30 Apr, 2006 21:10:10 Top
Jim Albert




Posts: 21
Joined: 2005-12-31
Thanks for the example that worked great. I had already tried this approach, but I put my close code in the "NewInspector" event and that did not work. When I moved it to the activate like your example it worked great. I did one other thing and set the height of the inspector to 0 so that the inspector is never visible to the user.

Thanks again,
Jim
Posted 08 May, 2006 16:56:07 Top