1

I developed a new Content Type with the name Excel. I created a new blank excel file on my local machine. This blank excel file is not created in SharePoint. I associated this template to my custom Content Type. I deployed it. When I create a new excel file from the ribbon I see in the advanced properties the contentTypeID of Content Type "Document".

I was expecting the contentTypeID from Content Type "Excel". Why?

When I save the excel file in SharePoint, it is saved on the contentType "Document" and not the expected Content Type "Excel".

Module to provision the excel template file:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="MyCompanyTemplates" RootWebOnly="TRUE" Url="_cts/MyCompanyTemplates">
    <File Path="MyCompanyTemplates\template.xlsx" Url="template.xlsx" Type="Ghostable" />
  </Module>
</Elements>

This is the contenttype provisioning xml:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: My Company Document (Intranet.SiteDefinitions\MycompanyContentType) (0x0101000ACB09B019144AB4A7A9EDD1CCCC4ED3) -->
  <ContentType ID="0x0101000ACB09B019144AB4A7A9EDD1CCCC4ED300E2221AFC747F4DB9959177F30C53DFB3"
               Name="MyCompany Excel Document"
               Group="MyCompany "
               Description="MyCompany Excel Document"
               Inherits="TRUE"
               Version="0">
    <FieldRefs>
    </FieldRefs>
    <DocumentTemplate TargetName="~site/_cts/CompanyNameTemplates/template.xlsx" />
  </ContentType>
</Elements>
2
  • Have you set Excel content type as s default content type?
    – Dipen Shah
    Dec 24, 2015 at 10:33
  • no, I dont want set excel as default content type. I would like to save documents in the contenttype I selected in the ribbon.
    – Ola
    Dec 24, 2015 at 13:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.