views:

248

answers:

4

I need to disable new item creation (new document) and Connect to Outlook in a specific document library.

I would like to remove the button completely if possible, but will settle for disabling it by eliminating the "Create a new document" dropdown as well as the on-click function of the New button itself.

The code provided here does not perform these removals, no matter how I configure it using the "new document" or "new item" or "connect to outlook" menu item names in the function. All the others work fine but I cannot get these to go away.

Any help is appreciated!

+1  A: 

Option 1: You could just remove creating new item permissions on that list, by breaking role inheritance for that list.

Option 2: Add event receiver on ItemAdding event and cancel item creation process by setting SPItemEventProperties.Cancel = true;. Examples are on the web.

In both ways you wont be able to add new items through nothing - no outlook, no GUI, no webservices.

Janis Veinbergs
A: 

Is it a custom doc lib that you have control over (ie the template)? If that is the case you could have a look at the example mentioned here:

http://blogs.msdn.com/syedi/archive/2008/07/19/customizing-the-list-toolbar-template-wss-3-0-moss.aspx

Johan Leino
A: 

Remove the contribute permissions on the doc lib for the users?

That way they can't add/upload new documents anymore to the doc lib.

W0ut
A: 

Sorry if the appliaction for which I was asking this question was unclear. Yes- it is MOSS 2007.

My concern is to allow uploading to the library but NOT allow "new" option (which opens the default linked app - Word in this case- and lets user create a document).

My preference would be something along the lines of the other solution I linked to, which allows addition of code in a CEWP to remove/disable various toobar optios. But "new" is not affected in the code provided in that example.

Johan, I believe the link you provided is the solution; however I can tell it is beyond my skill level. Thanks for the help.

Nancy