Reputation: 1056
I need to parse the "author"-property from a word document (97-2003). Preferably without using the Word COM-Object. I'am doing that same thing for .docx-documents by using the docx-nuget, but it seems that it can't handle the old .doc format.
I tried Spire.Doc but the free version is to limited (can't open large documents) and the paid version is a bit too expensive for me.
Is it possible at all to do this? And if so, how do I open and parse the "author"-property?
Upvotes: 0
Views: 416
Reputation: 1
We used dsoFile.dll to both read and write properties in doc-files.
https://support.microsoft.com/en-us/kb/224351
Add reference to Interop.DSOFile
using DSOFile;
public static string GetAuthorFromFile(string filename)
{
var test = new OleDocumentProperties();
test.Open(filename, true, DSOFile.dsoFileOpenOptions.dsoOptionDefault);
return test.SummaryProperties.Author;
}
See: Why dsofile.dll still need Office Installation?
As an alternative you could use: http://officefileproperties.codeplex.com/ but then you will also need to include Office Interop with your application.
Upvotes: -1