1

I am using the Xceed library to create a word file. Now I want to remove the Related People (Author and Modified By) property of the word document.

Here is my code:

using Xceed.Words.NET;
using Xceed.Document.NET;
using Image = Xceed.Document.NET.Image;
using Paragraph = Xceed.Document.NET.Paragraph;
using Formatting = Xceed.Document.NET.Formatting;
using Font = Xceed.Document.NET.Font;

How can I achieve this ?

Viveka
  • 340
  • 2
  • 14

1 Answers1

1

Answering my own question, this can be done by adding the AddCoreProperty as below:

// Load your Document
var doc = DocX.Load(@"your-docx-file-path");
// Access Metadata properties
var props = doc.CoreProperties;
// Update Metadata
doc.AddCoreProperty("cp:lastModifiedBy", "");
doc.AddCoreProperty("dc:creator", "");
doc.Save();

Set docx properties using library .docx

Viveka
  • 340
  • 2
  • 14