我正在使用EPPlus创建一个excel文件。现在我想删除Excel文件的Related People(Author and Modified By(属性。
我该怎么做?
回答我自己的问题时,可以将Workbook.Properties.LastModefiedBy
和Workbook.Properties.Author
添加到ExcelPackage
中,如下所示:
//Get file info of temp excel file
FileInfo newFile = new FileInfo(@"your-docx-file-path");
//Create ExcelPackage for excel file
ExcelPackage pck = new ExcelPackage(newFile);
pck.Workbook.Properties.LastModifiedBy = string.Empty;
pck.Workbook.Properties.Author = string.Empty;