tag:blogger.com,1999:blog-9049032025342264339.post8713112105759225928..comments2024-03-29T10:44:10.455+03:00Comments on sadomovalex's blog: Remove Sharepoint metadata from MS Office documentsAlexey Sadomovhttp://www.blogger.com/profile/18112105989691733410noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-9049032025342264339.post-28082547620884467712015-12-11T18:43:30.428+03:002015-12-11T18:43:30.428+03:00Anil,
I don't think that it is possible to rem...Anil,<br />I don't think that it is possible to remote it in javascript exactly like in my example, but you may iterate through all metadata of the document and set each field to empty value like shown here: http://sadomovalex.blogspot.com/2015/12/copy-taxonomy-field-values-using.html (this example shows how to manipulate with managed metadata fields via javascript object model, but working Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-78640300752856588982015-12-11T17:47:46.400+03:002015-12-11T17:47:46.400+03:00Hi Alexey,
Is is possible through jQuery, Please ...Hi Alexey,<br /><br />Is is possible through jQuery, Please share if you have some jQuery code sample to remove the properties of the document.<br /><br />Thanks,<br />AnilAnonymoushttps://www.blogger.com/profile/07298036959383676450noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-58212961172288707752015-11-05T10:35:23.186+03:002015-11-05T10:35:23.186+03:00This comment has been removed by the author.Hemal Shahhttps://www.blogger.com/profile/10153449262808204685noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-75335915834642019322014-10-03T13:20:42.964+04:002014-10-03T13:20:42.964+04:00Ketan,
most probably it is possible. Just check wh...Ketan,<br />most probably it is possible. Just check what methods are available in document.CustomFilePropertiesPart.Properties collection instead of RemoveAllChildren(). Also in predicate function you should return true only for those properties which you want to delete: i.e. check not only name of the root element like in my example (root.Name.LocalName == "properties"), but also Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-76347311233902787212014-10-03T12:43:17.044+04:002014-10-03T12:43:17.044+04:00Hi Alexey,
Many thanks for this article.
I just h...Hi Alexey,<br /><br />Many thanks for this article.<br />I just have one question, which is as follows<br />Can i remove or delete only specific property instead of removing all properties??<br />is this possible<br /><br />Thanks.Ketanhttps://www.blogger.com/profile/07160242638369662028noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-39457148418091840622014-06-16T13:03:38.006+04:002014-06-16T13:03:38.006+04:00pateketu,
for our documents this approach worked q...pateketu,<br />for our documents this approach worked quite well, but in your cases there may be additional places in the document which require cleanup. You may analyze them and then remove using the same approach with Open XML SDK.Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-82893232907408808512014-06-13T15:52:16.663+04:002014-06-13T15:52:16.663+04:00This seems to corrupt the document, problem seems ...This seems to corrupt the document, problem seems to be that ItemN.xml reference is not removed from <Relationships in _rels folder pateketuhttps://www.blogger.com/profile/06509408448826154728noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-825502342242470852013-07-02T19:05:09.914+04:002013-07-02T19:05:09.914+04:00Srikant Prasad,
did you add the following namespac...Srikant Prasad,<br />did you add the following namespaces (see above):<br />- System.IO;<br />- System.Linq;<br />- System.Xml.Linq;<br />- DocumentFormat.OpenXml.Packaging;<br />?Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-38132553376330659592013-07-02T15:13:16.749+04:002013-07-02T15:13:16.749+04:00var propertiesPart = document.MainDocumentPart.Cus...var propertiesPart = document.MainDocumentPart.CustomXmlParts.FirstOrDefault(p => predicate(p));<br /><br />The above line gives an error, CustomXmlParts.FirstOrDefault is not recognised.Anonymoushttps://www.blogger.com/profile/11057665205572522169noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-11142472991152103172013-06-20T15:15:29.658+04:002013-06-20T15:15:29.658+04:00as far as I know, pdf is not OpenXml format, i.e. ...as far as I know, pdf is not OpenXml format, i.e. metadata are not stored inside pdf itself. They are stored only in content database, which means that you have to get its metadata like in all other cases: file.Item["Field"].Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-84320981839599005432013-06-20T11:30:32.550+04:002013-06-20T11:30:32.550+04:00i want to know how to get pdf files matadata,Pleas...i want to know how to get pdf files matadata,Please let me know what are the extensions need to install in the sharepointAnonymoushttps://www.blogger.com/profile/01562379899394693331noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-20763166173419400062013-05-22T22:28:18.524+04:002013-05-22T22:28:18.524+04:00You need to add references to System.Xml.dll, Syst...You need to add references to System.Xml.dll, System.Xml.Linq.dll and DocumentFormat.OpenXml.dll. After that you have to add usings with the following namespaces:<br />- System.IO;<br />- System.Linq;<br />- System.Xml.Linq;<br />- DocumentFormat.OpenXml.Packaging;<br /><br />Install resharper and it will add necessary namespaces automatically :).Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-57366381434533672362013-05-22T18:51:26.634+04:002013-05-22T18:51:26.634+04:00It isn't recognizing Wordprocessing, CustomXML...It isn't recognizing Wordprocessing, CustomXMLPart or XElement. I have referenced the OpenXML and WindowsBase dlls, and added "using DocuentFormat.OpenXML;" Is there something else I should be referencing?<br /><br />Thanks!Anonymoushttps://www.blogger.com/profile/16692648468520686613noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-84517797031704599662013-05-22T11:14:21.301+04:002013-05-22T11:14:21.301+04:00hi Todd,
as far as I remember the code above worke...hi Todd,<br />as far as I remember the code above worked in the console application, i.e. it should work without any changes. What problems do you have?Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-15682346876677767612013-05-22T08:44:58.570+04:002013-05-22T08:44:58.570+04:00Thank you for posting this. I'm having some tr...Thank you for posting this. I'm having some trouble getting this to work. Would you be able to post the complete code for this?Anonymoushttps://www.blogger.com/profile/16692648468520686613noreply@blogger.com