How I can deleting all document properties with Aspose.Words like Microsoft Office 2007 “Document Inspector” command? I tried to use
document.BuiltInDocumentProperties.Clear();
document.CustomDocumentProperties.Clear();
but after saving it (in DOCX as sample) after checking document properties in Microsoft Word 2007 (SP2) Document Inspector find some properties:
Hi Alexander,
Thanks for your request. It is impossible to remove all built-in document properties, MS Word does not do so as well. It seems Document Inspector tells that there are properties or personal information, if built-in document properties are not updated. For example here what Aspose.Words writes into the document (I used WML document for testing):
<o:DocumentProperties>
<o:Revision>0</o:Revision>
<o:TotalTime>0</o:TotalTime>
<o:Pages>0</o:Pages>
<o:Words>0</o:Words>
<o:Characters>0</o:Characters>
<o:Lines>0</o:Lines>
<o:Paragraphs>0</o:Paragraphs>
<o:CharactersWithSpaces>0</o:CharactersWithSpaces>
<o:Version>0.0000</o:Version>
</o:DocumentProperties>
And here is what MS Word writes, when I click “Remove All” in Document Inspector:
<o:DocumentProperties>
<o:Revision>1</o:Revision>
<o:TotalTime>0</o:TotalTime>
<o:Created>2009-07-03T11:49:00Z</o:Created>
<o:LastSaved>2009-07-03T11:49:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>0</o:Words>
<o:Characters>0</o:Characters>
<o:Lines>1</o:Lines>
<o:Paragraphs>1</o:Paragraphs>
<o:CharactersWithSpaces>0</o:CharactersWithSpaces>
<o:Version>12</o:Version>
</o:DocumentProperties>
As you can see, MS Word just updates values of built-in document properties.
Best regards.
Thanks a lot for example. And have last question: if I “Remove all properties” from Microsoft Word Document Inspector and save document, after reopening Document Inspector doesn’t find them again. May be some flag in document?
Yes, it seems Ms Word also writes flag in docPr:
<w:docPr>
<w:view w:val="print" />
<w:zoom w:percent="100" />
<w:removePersonalInformation />
Best regards.
Can you add this flag when clearing document properties?
Thanks for your inquiry, Alexander. We will consider adding such feature in Aspose.Words.
Best regards.