none
SharePoint 2007 - Configure the Default Behaviour for Browser-Enabled Documents

    Question

  • I would like to set the default behavior for browser enabled documents to Open in Clinet applciation. I know that we can set this in Advanced Settings page of Document Library settings. I have few hundred sites under the site collection. It is really difficult to manually set this option for each document library in each site. Is there any way we can set this option at site collection/Web appliation/farm level? If not I may have to come up with some automated script. Any thoughts?

    Monday, September 19, 2011 3:23 PM

Answers

  • Hi,

    Yes this requires customizations. You can create a feature or a console application to execute the required code.

    I am attaching a sample to do so for one document library and it can be extended to all.

                 SPSite site = new SPSite(YourSiteUrl);

                SPWeb web = site.OpenWeb();

                SPDocumentLibrary library = (SPDocumentLibrary)web.Lists[Your Doc Library name];

                library.DefaultItemOpen = DefaultItemOpen.Browser;

                library.Update();

    Do let me know if you require full code.

    I hope this will help you out.


    Thanks, Rahul Rashu
    • Marked as answer by Pengyu Zhao Thursday, September 29, 2011 2:09 AM
    Wednesday, September 21, 2011 5:03 AM