.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Changing the content type of a document

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :SharePoint
Hi everybody, Can we change the content type of a document ? For example, I have a custom content type 'A' that inherits from the default document content type. If I upload a document (on behalf of the windows explorer) and the default document content type is assigned, can I change it to the content type 'A' after ? Thanks in advance.Psyllos

View Complete Post

More Related Resource Links

Unable to collaborate on document in SharePoint Workspace which has Content Type with more than look

1/ Add a new document into Shared Document library. 2/ In Shared Document of this workspace, add new content type having 12 lookup columns. 3/ Create a new workspace 4/ Add a user into the workspace with the editable permission (Contribute or Full Control). 5/ Open the document in Word 2007, in the Document Management Pane Using system account: the document is shown in the Document tab. Using normal account: the document is not shown in the Document tab. 6/ If we use Dws.GetDwsMetaData method to get information of the workspace site and lists it contains then:    + Using system account credential, this method returns the document's information in Shared Document library. The result contains the below xml data: <List Name="Documents"> <ID>{CFEDFC3C-2AD3-4A0E-88B6-821BF57CACDB}</ID> <z:row ows_FileRef="Shared Documents/Test Content Type.docx" ows_FSObjType="0" ows_Created="2010-09-01T02:38:31Z" ows_Author="1073741823;#System Account" ows_Modified="2010-09-01T02:38:31Z" ows_Editor="1073741823;#System Account" ows_ID="1" ows_ProgID="" xmlns:z="#RowsetSchema" /> </List>     + Using the normal user credential, this method does not return the document information in Shared Document library. I notice

How To "Upload a new document template" to Content Type via Web Service

I hope someone can help me. Let me begin by saying that I'm not a programmer; so I 'may' not get the terminology exactly right, but hopefully someone will know what I mean. I am using SharePoint 2010 along with a 3rd party application that I'm using for creating, managing and executing workflows.  The workflow application I'm using is Nintex Workflow 2010.  As such, I can only use functions, services, commands...etc...that are offered to me by that application. Anyway, what I am trying to do is simply replace a document template that is being used for a particular content type with another document template. For this I believe I need to use the Webs.UpdateContentTypeXmlDocument Method.  More information is provided here (http://msdn.microsoft.com/en-us/library/websvcwebs.webs.updatecontenttypexmldocument.aspx). The Webs.UpdateContentTypeXmlDocument method requires two parameters..."contentTypeId" and "newDocument". "contentTypeId" - I have got the Content Type ID by clicking on the content type and viewing the URL shown in my browser.  So, I am confident that my content type id is correct and is "0x010100C392CF11DE923A4E8AB9018B0A42119303". "newDocument" - The MSDN article states...'A string that represents the XML document to replace the existing XML document.".  To be honest, I'm not 100%

URGENT: Document Library Content Type not inheriting some fields from parent Site Content Type


I have a situation that has foxed me!! I have a site level content type that has 8 fields... I use this to create more content types at the site level and use these in multiple Document Libraries (I have 40 doc libs).  This works fine for 38 of the libraries.  But for 2 of them... 2 of the columns are not showing up on the document libraries.  These are user lookups fields.  I am not sure why it's not working in these libraries only!  When I use the same content type in another library... the inheritance does not break for these fields!

Anyone please provide some guidance on this?  I am using WSS 3.0 and SPD to do workflows.

On another note... the content type has a template (in excel) attached to it.  When I create the content manually using the content type from the New menu option, the template is used... however, when I try to add it using an SPD workflow, it creates a blank template... the content type template is not being used.

Please help... I am in a fix and need to release this application today!!!

Upload document and set content type



We have an existing accounting system that produces various reports and spreadsheets on a schedule, which are then emailed out to recipients.  Cleverly, email is the _only_ mechanism for delivering the reports out of the system, though I have full control over the contents of the file produced.

To ensure that the reports end up organised in our sharepoint site, I had imagined adding the content type and other metadata into the spreadsheet, in order that they can be emailed into a drop library and the content organiser can apply rules to put the files in the right place.  As there are a large number of reports, I was thinking that this could lend itself to a common approach, rather than needing to adjust every report individually.

My question is:

 - is it possible to apply metadata within the file when it is produced, and have sharepoint pick it up?  If so, how do I go about doing it?



Folder Content Type in Document Set



Is it possible to include a Folder Content Type as the  default content , when a new instance of Document Set content type is created ? If so, how can we do this?


How to Link to a Document content type but linking to a Folder

I have implemented the known "Link to a Document" content type to a Document Library (referenced below).  This works fine to documents, but we need to also enter UNC paths to Folders like file://\\servername\sharename\foldername

We can NOT create shortcuts to these folders, which is a work around someone else published.

If you add the Hyperlink field it allows you to enter a UNC path to externally stored folder just fine. So there must be some way to make this Link to a Document content type also open UNC Folders accurately.


Code Snippet
function HasValidUrlPrefix_Override(url)
            var urlLower=url.toLowerCase();
            if (-1==urlLower.search("^http://") &&
            -1==urlLower.search("^https://") && -1==urlLower.search("^file://"))
            return false;

InfoPath 2007 Form Content Type does not save as infopath form but as xml document.


I have a couple of infopath forms deployed to sharepoint as content types. Normally, when a user creates a new document of an infopath content type, the form opens in browser mode and ,when the user fills in the form and saves the form, a new document is created in the document library with the correct icon and progid.

This was before... Now, whenever I save a form, the form submits correctly, i see the file in de document library, BUT it has the icon of an XML document, all the infopath functionality is gone and when I click the file, I get a save as dialog...

The form itself hasn't changed that much and even when I redeploy a version that worked before it still does not work. However, when I create a new doc lib and associate the malfunctioning form there, the behavior is normal and i can still reopen the saved form.


Little sidenote: I have 7 different forms that now do not work on my test machine. It used to be only one, but after redeploying them, all of them have the same problem. Now when I deployed these forms in a production environement, the same thing started happening there. So I stopped the deployment and in production there is just the newly deployed form that does not work.

I have already tried reassociating the form to the doc lib. And everything looks normal in central administration.

Any suggestions?


Adding New Custom Folder Content Type doesn't show up on the Document Library New Menu


I been trying to add new custom folder content type to the document library programatically in my sandbox environment and it does show up on the document library. But, when I move same code to the almost similar configured SP2010 environment, adding new folder content type to the document library doesn't show up on the document library's new menu.

Here is the code? Since this code works fine in my sandbox environment, is there any other settings I should check on the server environment which would cause hiding content type on new menu of document library.

  class Program
    static void Main(string[] args)
      SPSite spSite = new SPSite("http://sp2010vm");
      foreach (SPWeb spWeb in spSite.AllWebs)
        spWeb.AllowUnsafeUpdates = true;

        //For each site, cycle through lists
        bool isDocLibraryExists = false;
	      foreach(SPList spList in spWeb.Lists)
          if(spList.Title == "Classified Documents")
             isDocLibraryExists = true; 
        if(isDocLibraryExists == true)
          //Create new doc library
          SPList splist = spWeb.Lists["Classified Documents"];

          //Create Content Type
          SPContentType documentContentType = spWeb.AvailableContentTypes["Classified Documents Folder"

The workflow associated with the document content type won't be seen wss 3.0


Hello! I want to use a custom workflow,associated with the  document content type. But In the  doc library when I click on the document-item wich belongs to that content type, the  workflow associated with that content type won't appear. Maybe I missed something.

Any suggestion link, sample   would be appreciated.


External Data Fields in a Word Template saved as a content type in a document library with multiple


I have created a Word Template for a Document Library that has an External Data Column in it of Client Name which also adds Client Address1, Client Address2, Client City, Client State, & Client Zip.  Now this works fine for a Document library with that template as the Template.dotx file. 

I want to be able to make a bunch of Templates and have them all as Content Types in one Library.  When I do this I cannot get the External Data Quick Parts to work.

Anyone have any ideas?

sharepoint changing content type layout has no effect on old pages




I have a content type layout. After I changed it, it had no effects on existing pages. 

When I add new page with this content type it has latest version.


How can I fix this? I want my current pages to use new content type layout.



Custom document library list template issues with custom content type


Either I don't know what SharePoint is doing or I don't know what I'm doing (or both, which is more likely).

I'm attempting to create a Custom Document Library template with a custom content type association (Custom Document), all using a feature. When I create
a document library based on the installed template, the content type association is there. However, when I click on New Custom Document, the template.dotx does not reflect the Custom Document content type association. The Word document information panel does not show any Custom Document content type properties (like Title and Comments).

Here are the steps I've taken:

1. Create the feature.xml with element manifests of contentType.xml and CustomDocumentLibrary.xml
2. Create the contentType.xml (Custom Document) with an additional field reference for Comments
3. Create the CustomDocumentLibrary.xml for the list template
4. Create a Custom Document Library subfolder that contains the same files that are in the 12\TEMPLATE\FEATURES\DocumentLibrary\doclib folder.
5. Edit the schema.xml to use the new content type and field reference
6. Deploy and activate the feature
7. Create a new "Custom Document Library"
8. Go to Custom Document Library Settings and verify the Custom Document content type is being used
9. Click on New Custom D

Content Type Properties/Fields on Document Template


I have created a content type and added some custom site columns to it.  I have also created a document template (.dotx) where I have added some of the columns as fields that appear in the footer and header of the document template.  In the Advanced Settings of my Content Type I have added the .dotx template as the template for the Content Type.

In a document library I added the content type.  When I create a document from the content type in that document library the fields on the new document do not get updated when I select different data for any of the columns in the Document Information Panel.

Even when I save the document and reopen it the data in the columns on the Header or Footer does not get updated so there is a discrepancy between the data selected on the DIP and what is shown in the Header or Footer.

What am I doing wrong?

PDF form as Content Type for SharePoint Document Library


Is there any way to use PDF form (.pdf)  template as Content type for document library??

I have a pdf form template and i want to make a content type of it, so i can use it for my Document Library. I defined a new content type of it with following settings:

Select Parent Content From dropdown: Special Content Types,
    Parent Content Type Dropdown: Unknown Document Type

Under Advance Settings i uploaded the pdf form template to server. Under Document Library Settings I add this content type to it, now when i click NEW button it gives me an error message saying:

"The Document couldn't be created. The required application may not be installed properly, or the template for this document library can't be opened"

Seems like SharePoint doesn't integrate with or support Adobe Reader to open PDF form as Content Type or I am missing something there (for example: dll ).

I would really appreciate if you help me on this. Thanks


Document Library/Content Type Planning


Im in the process of moving a network drives content to a new document library.

The network contains all our IT Sarbanes Oxley documentation/checks


What im struggling with is how to plan the document library.

Should I create a team site for this network drive and have multiple document libraries?
Or should I create just one document library?

What im struggling with is how to plan andocument library.


for example,
currently every morning a member of staff completes a check of server backups.
They modify an Excel spreadsheet which contains a row for each site/server and a column for each day.
This Document is located at O:\IT Procedures Policies & Controls\Controls\KC202 - Monitor Backups
Every month a new Spreadsheet is started which is based on a template.

My first idea was to create a content type for this check called 'KC202' as a template can be assigned then each month the user just needs to hit the dropdown button and then 'new KC202'.
the problem with this is we have 37 folders within 'Controls' ranging from KC000 to KC507 all of which will need template documents (each being Unique)

Then I thought the best idea would be to have a content type for 'Controls' with metadata for the 'KC' number. Whenever a new document is created the user can

Custom Content Type is missed while restoring Document Libary template



I have a document library and i use a custom template "templateA" in it,This also inherits from "Folder" content type. When i'm restoring this template backup file to a new library,It missed the content type "templateA" and appears as "Folder" in all items.

I use a publishing site, and i created the content type in site level, I also created the document library in sub site level where i used the template,

Is there any work arround to get the custom content type in restored Libray.I use moss 2007.


WSS 3.0 Content Type with Office 2007


We're currently encoutering an issue on our production servers with Office 2007 documents. In essence, the Content Type for all docx, xslx, and pptx documents cannot be changed away from the site default on all newly created sites.

I've even done some step by step debugging on an SPItem insert and I can set the content type to a custom type, but it reverts back to the site's default Content Type on Update(). Other file types - .doc, .xls, .tif, .txt, and .jpg - have all been tested, and all work as expected (the Content Type changes correctly).

Thanks in advance!


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend