Paul Liebrand's Weblog

Welcome to my blog mainly about SharePoint

Skip to: Content | Sidebar | Footer

Google Search

Adding Office File Types to all Document Libraries New Menu without Content Types

14 May, 2008 (09:34) | SharePoint | By: Liebrand

One of the questions I am asked the most from my end-users when using SharePoint is "Why can’t I select new Word, Excel, and PowerPoint from the new drop down on all my document libraries?"

With the introduction of Content Types in Windows SharePoint Services (WSS 3.0 solved this problem by creating a content type called Word Document, Excel Document, and PowerPoint Document. They would then apply those content types to all the document libraries on their site.

 ContentTypes

While WSS 3.0 added this flexibility and my end-users were happy I noticed an issue with this implementation. When users were saving documents to SharePoint via Windows Explorer or the multiple file upload it selects the default content type (Word Document).

ContentTypeIssue

As you can see, this starts to cause an issue because all different file types start being marked incorrectly. Of course, the users can go back and change this to make it work but realistically this is not going to happen.

At the end of the day, content types should be used as they were intended (Memos, Invoices, etc) and simply creating one for Word, Excel, and PowerPoint was a "hack" to solve an end-user experience problem.

The Solution

I created a SharePoint feature (Source and Solution links available below) that basically adds Word, Excel, and PowerPoint to the new drop down menu of all document libraries within a site collection. This implementation does not make use of Content Types and allows users to quickly create a new document of these types in any document library. The beauty of this implementation is that if a document library does have content types, such as an invoice, when the user saves a document the first time (after selecting Word, Excel, or PowerPoint) it will prompt them to select the appropriate content type. Since my new menu items are not implemented as content types they are not visible from within the Content Type selector.

The following is a series of screen captures that demonstrate my implementation of Office File Types.

Once the feature is activated via the Site Collection Features, all document libraries will now look like this:

OfficeFileTypes

As you can see, you can still have content types and the Office File Types appear at the bottom.

When the Office application launches and you click Save and provide a filename, it will now ask you to select the appropriate content type:

ChooseType

The document library will refresh and everything appears as it should be:

StoredDocuments

I personally think this just creates a better end-user experience especially for those people who work a lot with Office documents in SharePoint.

Known Limitations

Right now the Office File Types feature does not recognize the folders you drill into. This was really put together as a proof of concept and will most likely be enhanced overtime.

Source and Solution

Note: No assembly was developed to get this to work. The feature basically just adds some custom actions to the document library list type and all the magic happens through JavaScript.

http://www.codeplex.com/OfficeFileTypes

I hope you find this useful.

[Update – 5/15/2008]

Just incase anybody needed this information — Here are the installation instructions:

 

stsadm -o addsolution -filename OfficeFileTypes.wsp

stsadm -o deploysolution -name OfficeFileTypes.wsp -url <url of your site> -immediate -allowgacdeployment

 

Once the solution has been deployed, you just navigate to the site collection and activate the Office File Types feature.

[Update – 7/7/2008]

I removed the rights attribute from the OfficeFileTypes.xml because SharePoint completely ignores this if you have unique permissions set on the document library itself (thanks Marco). In this particular case, since I am added the Office file types to the new menu which is only visible to people who can add content, the rights was not necessary. However, this seems to be a bigger issue if you wanted to add something to the actions menu, or settings menu.

Both source and WSP files have been updated.

[Update – 7/8/2008]

Even though the new solution works around the issue mentioned above it has introduced another scenario. Because I removed the AddListItems right the New menu now shows up with the Office File Types for users who have read-only rights.

I have started a thread on the MSDN SharePoint Development forums (http://forums.microsoft.com/forums/ShowPost.aspx?PostID=3590618&SiteID=1) so hopefully Microsoft can offer some guidance to this issue. I personally believe this is a bug, or CustomAction implementation issue that will have to be resolved by Microsoft so that I can use the Rights attribute of CustomAction again.

[Update – 7/8/2008 – Part II]

Due to the issues I ran into using the Rights attribute of the feature I completely re-worked the whole solution. Now it uses code to figure out if they have the appropriate permissions or not based on the library and folder they are in.

Both the source and WSP file has been updated.

[Update – 7/11/2008]

The solution has been updated to hide and show the specific Office Types depending on what the document content type has been setup for. For example, if the default document content type is an XLS file, the Excel Office File type will not show on the new drop down. The feature also now supports localization, so you simply need to copy the officefiletypes.resx file and create it for your appropriate language and you are good to go.

[Update – 7/24/2008]

I moved this project to CodePlex at http://www.codeplex.com/OfficeFileTypes for those interested in the Source and Release.


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

  • Odd. When my users do not have the ability to add content they “new” button is not visible. Is the Office File types the only thing listed there, or do you also have “New Folder” and “New Document”.

    What is the version of SharePoint you are running?

  • Marco

    Hi, only the Office File Types are shown.
    MOSS 3.0 SP1 (12.0.0.6039).

    I’ve mentioned this situation in comment#12.

  • Marco

    Hi, only the Office File Types are shown.
    MOSS 3.0 SP1 (12.0.0.6039).

    I’ve mentioned this situation in comment#12.

  • Marco

    Hi, only the Office File Types are shown.
    MOSS 3.0 SP1 (12.0.0.6039).

    I’ve mentioned this situation in comment#12.

  • Marco,

    Please install the new WSP file using the link above in your environment. This should resolve the issue you outlined in comment#12. See my comment#15. I fixed it.

  • Marco,

    Please install the new WSP file using the link above in your environment. This should resolve the issue you outlined in comment#12. See my comment#15. I fixed it.

  • Marco,

    Please install the new WSP file using the link above in your environment. This should resolve the issue you outlined in comment#12. See my comment#15. I fixed it.

  • Marco

    Hi Liebrand,

    The issue that a read only user now has a new button with only the Office File Types still exists.

  • Marco

    Hi Liebrand,

    The issue that a read only user now has a new button with only the Office File Types still exists.

  • Marco

    Hi Liebrand,

    The issue that a read only user now has a new button with only the Office File Types still exists.

  • Marco,

    Try again — the solution has been completely redone and it should solve that problem (hopefully).

  • Marco,

    Try again — the solution has been completely redone and it should solve that problem (hopefully).

  • Marco,

    Try again — the solution has been completely redone and it should solve that problem (hopefully).

  • Marco

    Hi Paul,

    The last version of the solution works!
    I’ve tested it tonight. And it seems to work fine!

    Do you have plans to make it multilingual?

    Thanks for spending your time in fixing the solution.

    Regards,

    Marco

  • Marco

    Hi Paul,

    The last version of the solution works!
    I’ve tested it tonight. And it seems to work fine!

    Do you have plans to make it multilingual?

    Thanks for spending your time in fixing the solution.

    Regards,

    Marco

  • Marco

    Hi Paul,

    The last version of the solution works!
    I’ve tested it tonight. And it seems to work fine!

    Do you have plans to make it multilingual?

    Thanks for spending your time in fixing the solution.

    Regards,

    Marco

  • Pingback: SharePoint Feature or Enhancement Requests « Paul Liebrand’s Weblog()

  • Guney

    Hi Guys;
    ı have complete the installation with
    stsadm -o addsolution -filename OfficeFileTypes.wsp
    stsadm -o deploysolution -name OffceFileTypes.wsp -allcontenturls -allowgacdeployment -immediate

    there commands but new file types didnt appear ??

    Did I miss something ?

  • Guney

    Hi Guys;
    ı have complete the installation with
    stsadm -o addsolution -filename OfficeFileTypes.wsp
    stsadm -o deploysolution -name OffceFileTypes.wsp -allcontenturls -allowgacdeployment -immediate

    there commands but new file types didnt appear ??

    Did I miss something ?

  • Guney

    Hi Guys;
    ı have complete the installation with
    stsadm -o addsolution -filename OfficeFileTypes.wsp
    stsadm -o deploysolution -name OffceFileTypes.wsp -allcontenturls -allowgacdeployment -immediate

    there commands but new file types didnt appear ??

    Did I miss something ?

  • Guney,

    Make sure you activate the feature via the Site Collection Features menu. Once activated, you should see the Office File Types appear on your New Menu.

    Thanks,

    Paul

  • Guney,

    Make sure you activate the feature via the Site Collection Features menu. Once activated, you should see the Office File Types appear on your New Menu.

    Thanks,

    Paul

  • Guney,

    Make sure you activate the feature via the Site Collection Features menu. Once activated, you should see the Office File Types appear on your New Menu.

    Thanks,

    Paul

  • Chris

    Hi,
    This is a great solution Paul. I have upgraded sites from SPS2003 to MOSS2007, and activated your solution. I find that the file types are not displaying in the ‘new’ menu for me on upgraded document libraries, but are appearing in ones that I newly create in the same site. I am the farm admin, so it shouldnt be a permissions issue. any ideas why this is happening?
    Chris

  • Chris

    Hi,
    This is a great solution Paul. I have upgraded sites from SPS2003 to MOSS2007, and activated your solution. I find that the file types are not displaying in the ‘new’ menu for me on upgraded document libraries, but are appearing in ones that I newly create in the same site. I am the farm admin, so it shouldnt be a permissions issue. any ideas why this is happening?
    Chris

  • Chris

    Hi,
    This is a great solution Paul. I have upgraded sites from SPS2003 to MOSS2007, and activated your solution. I find that the file types are not displaying in the ‘new’ menu for me on upgraded document libraries, but are appearing in ones that I newly create in the same site. I am the farm admin, so it shouldnt be a permissions issue. any ideas why this is happening?
    Chris

  • Chris,

    The only thing I can think that is causing this issue is if the upgraded document libraries do not have the “101” template Id. I recommend the following:

    1. Download SharePoint Manager 2007 (http://www.codeplex.com/spm)

    2. Navigate to one of the document libraries that are NOT working and check the “BaseTemplate” and “BaseType” fields. These should be “DocumentLibrary”.

    3. If it does say document library, check the PropertiesXml and see what the number is for ServerTemplate. This should read “101”.

    Please report back your findings.

    Thanks,

    Paul

  • Chris,

    The only thing I can think that is causing this issue is if the upgraded document libraries do not have the “101” template Id. I recommend the following:

    1. Download SharePoint Manager 2007 (http://www.codeplex.com/spm)

    2. Navigate to one of the document libraries that are NOT working and check the “BaseTemplate” and “BaseType” fields. These should be “DocumentLibrary”.

    3. If it does say document library, check the PropertiesXml and see what the number is for ServerTemplate. This should read “101”.

    Please report back your findings.

    Thanks,

    Paul

  • Chris,

    The only thing I can think that is causing this issue is if the upgraded document libraries do not have the “101” template Id. I recommend the following:

    1. Download SharePoint Manager 2007 (http://www.codeplex.com/spm)

    2. Navigate to one of the document libraries that are NOT working and check the “BaseTemplate” and “BaseType” fields. These should be “DocumentLibrary”.

    3. If it does say document library, check the PropertiesXml and see what the number is for ServerTemplate. This should read “101”.

    Please report back your findings.

    Thanks,

    Paul

  • Chris

    BaseTemplate is empty.
    BaseType is DocumentLibrary.
    The server template says 165. I clearly not count on the value to be 101! Suggestions?

  • Chris

    BaseTemplate is empty.
    BaseType is DocumentLibrary.
    The server template says 165. I clearly not count on the value to be 101! Suggestions?

  • Chris

    BaseTemplate is empty.
    BaseType is DocumentLibrary.
    The server template says 165. I clearly not count on the value to be 101! Suggestions?

  • Chris,

    The only thing I can initially think to try is the following.

    1. De-activate the OfficeFileTypes feature.
    2. Navigate to the 12 hive / Template / Features / OfficeFileTypes folder.
    3. Open the OfficeFileTypes.xml file and add another section that is exactly the same as the one that is there. The only difference is change 101 to 165.

    You would now have two custom actions — one that connects to regular WSS 3.0 document libraries, and one that connects to WSS 3.0 upgraded from WSS 2.0 document libraries.

    4. Re-activate the feature

    Thanks,

    Paul

  • Chris,

    The only thing I can initially think to try is the following.

    1. De-activate the OfficeFileTypes feature.
    2. Navigate to the 12 hive / Template / Features / OfficeFileTypes folder.
    3. Open the OfficeFileTypes.xml file and add another section that is exactly the same as the one that is there. The only difference is change 101 to 165.

    You would now have two custom actions — one that connects to regular WSS 3.0 document libraries, and one that connects to WSS 3.0 upgraded from WSS 2.0 document libraries.

    4. Re-activate the feature

    Thanks,

    Paul

  • Chris,

    The only thing I can initially think to try is the following.

    1. De-activate the OfficeFileTypes feature.
    2. Navigate to the 12 hive / Template / Features / OfficeFileTypes folder.
    3. Open the OfficeFileTypes.xml file and add another section that is exactly the same as the one that is there. The only difference is change 101 to 165.

    You would now have two custom actions — one that connects to regular WSS 3.0 document libraries, and one that connects to WSS 3.0 upgraded from WSS 2.0 document libraries.

    4. Re-activate the feature

    Thanks,

    Paul

  • Chris

    I haven’t had any success. So I decided to just replace 101 with 165 just to enable on th old document libraries only- the SP error page displays. I also restarted iis just to be sure the xml files are re-cached. Paul, I like this solution if we can get it to work with multiple registration IDs. please email me: [email protected]

  • Chris

    I haven’t had any success. So I decided to just replace 101 with 165 just to enable on th old document libraries only- the SP error page displays. I also restarted iis just to be sure the xml files are re-cached. Paul, I like this solution if we can get it to work with multiple registration IDs. please email me: [email protected]

  • Chris

    I haven’t had any success. So I decided to just replace 101 with 165 just to enable on th old document libraries only- the SP error page displays. I also restarted iis just to be sure the xml files are re-cached. Paul, I like this solution if we can get it to work with multiple registration IDs. please email me: [email protected]

  • I’ll see what I can find out and get back to you.

    Paul Liebrand

  • I’ll see what I can find out and get back to you.

    Paul Liebrand

  • I’ll see what I can find out and get back to you.

    Paul Liebrand

  • Chris

    Thanks Paul,
    SharePoint Manager does not let me fill in the blank baseTemplate, nor will it allow me to change the ServerTemplate in SchemaXML or PropertiesXML. This issue is a result of upgrading a custom 2003 STS, unfortunately I have to live with it.

  • Chris

    Thanks Paul,
    SharePoint Manager does not let me fill in the blank baseTemplate, nor will it allow me to change the ServerTemplate in SchemaXML or PropertiesXML. This issue is a result of upgrading a custom 2003 STS, unfortunately I have to live with it.

  • Chris

    Thanks Paul,
    SharePoint Manager does not let me fill in the blank baseTemplate, nor will it allow me to change the ServerTemplate in SchemaXML or PropertiesXML. This issue is a result of upgrading a custom 2003 STS, unfortunately I have to live with it.

  • Chris

    Hi Paul,
    Any luck fixing that error when I change the server template value? Is there anything I can provide you to help (such as the STS)? Again, great solution, we’d love to use it.

  • Chris

    Hi Paul,
    Any luck fixing that error when I change the server template value? Is there anything I can provide you to help (such as the STS)? Again, great solution, we’d love to use it.

  • Chris

    Hi Paul,
    Any luck fixing that error when I change the server template value? Is there anything I can provide you to help (such as the STS)? Again, great solution, we’d love to use it.

  • Chris,

    I am still working on building out my WSS 2.0 environment so I can insure there is no abnormalities with the upgrade to WSS 3.0 and templates (which I cannot image there will be). Should have some feed back for you any day now.

    Thank you for your patience.

  • Chris,

    I am still working on building out my WSS 2.0 environment so I can insure there is no abnormalities with the upgrade to WSS 3.0 and templates (which I cannot image there will be). Should have some feed back for you any day now.

    Thank you for your patience.

  • Chris,

    I am still working on building out my WSS 2.0 environment so I can insure there is no abnormalities with the upgrade to WSS 3.0 and templates (which I cannot image there will be). Should have some feed back for you any day now.

    Thank you for your patience.