Good afternoon,
I need to read the properties and values of them in a word document, so far I have only managed to access the name of them but not their value. Thanks in advance for the help.
This is the code I have:
Microsoft.Office.Interop.Word._Application oWord = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word._Document oDoc;
object originalFormat = Missing.Value;
object routeDocument = Missing.Value;
object oMissing = Missing.Value;
object saveChanges = false;
object oDocAuthorProp;
Type typeDocAuthorProp;
oWord.Visible = false;
object oFalse = false;
object filePath = @"C:\Users\Ales\Documents\PRUEBAS 40257.doc";
try
{
oDoc = oWord.Documents.Open(ref filePath, ref oMissing, ref oFalse, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
oDoc.Activate();
var oDocBuiltInProps = oDoc.BuiltInDocumentProperties;
Type typeDocBuiltInProps = oDocBuiltInProps.GetType();
foreach (var item in oDocBuiltInProps)
{
string nombre = item.Name;
}
}
catch (Exception ex)
{
throw ex;
}