Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Sharepoint Web Service: Update Content Type of Office-based XML Files

$
0
0

We have files in a SharePoint O365 library that need a custom Content Type programmatically set from an Excel spreadsheet.  The content types are enabled in the library.  The spreadsheet contains the file names along with the content type to assign.  This is part of a migration project from Notes. 

I'm using web services from Excel (MSXML2.XMLHTTP, UpdateListItems) and it's working fine on 90% of our files, except for Office XML-based documents such as: xlsx, docx, pptx, xlsm, et al.  For some reason, I'm unable to update the content type via web services for these files.  The older 2003 to 2007 Office files such as xls, doc and ppt work just fine. 

I can change the content type manually for these files in the library but there are 17,000 of them (across 200+ sites) so a manual solution is not ideal.  When I change the type manually, then test web services to change it back to Document (the default), it works.  I even tried changing the default of the library to the value I need to set, but no luck.  Since the code is working for most of the files, just not these types, I'm not sure posting the code would matter, but if you want to see anything, let me know.

Any help on how to assign content type to Office XML-based documents, using web services, would be appreciated.

Regards, Robert

Update: I should mention that even though the content type is not being set, web service response does not generate an error code/message.  I have validated the XML for the UpdateListItems request and it shows the correct content type is sent, just not set for these file types.

Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>