How to delete existing custom document properties (2019-04-18 22:38 by rene_juhr #82863)
I am trying to delete existing custom document properties from word documents... unfortunatly I am stuck with this...
public void DeleteAllProps(string SCurrentDocs)
var VWordApp = new NetOffice.WordApi.Application();
var VDoc = VWordApp.Documents.Open(SCurrentDocs);
var VCustomDocProp = (DocumentProperties)VDoc.CustomDocumentProperties;
foreach (var VProp in VCustomDocProp)
After saving the Document the custom document properties are still existing. Reading the properties in another Method was super easy...
Does anyone has a suggestion how to solve this problem?
Re: How to delete existing custom document properties (2019-04-22 19:43 by jozefizso #82869)
You may try to set the VDoc.Saved property to false before saving. Sometimes, Word may not detect the document has changed when custom properties are deleted. By setting Saved to false, you will force MS Word to save the document when VDoc.Save() is called.