H
Heidi
I'm trying to enumerate the custom properties on a word document using C# and
I am not having any luck. Does anyone either have an example or know where I
am going wrong?
I've been trying variations on the following:
CustomProperties properties = (CustomProperties)
wrdDoc.CustomDocumentProperties;
//System.Collections.IEnumerator pEnumerator = properties.GetEnumerator();
//for (int i=0;i< properties.Count;i++)
foreach (CustomProperty thisProperty in (CustomProperty)properties.GetItems())
{
//CustomProperty thisProperty = (CustomProperty)
Microsoft.Office.Interop.Word.get_item( i);
//CustomProperty thisProperty = (CustomProperty) properties;
string pName = thisProperty.Name;
string pValue = thisProperty.Value.ToString();
string pType = thisProperty.Value.GetType().FullName;
pType = string.Empty;
}
getEnumerator shows up in intellisense but won't compile. if I try to use
properties I get an error that says I should try to access get_item
directly but I get a compiler error from that - and it doesn't show up in
intelllisense.
thanks!
I am not having any luck. Does anyone either have an example or know where I
am going wrong?
I've been trying variations on the following:
CustomProperties properties = (CustomProperties)
wrdDoc.CustomDocumentProperties;
//System.Collections.IEnumerator pEnumerator = properties.GetEnumerator();
//for (int i=0;i< properties.Count;i++)
foreach (CustomProperty thisProperty in (CustomProperty)properties.GetItems())
{
//CustomProperty thisProperty = (CustomProperty)
Microsoft.Office.Interop.Word.get_item( i);
//CustomProperty thisProperty = (CustomProperty) properties;
string pName = thisProperty.Name;
string pValue = thisProperty.Value.ToString();
string pType = thisProperty.Value.GetType().FullName;
pType = string.Empty;
}
getEnumerator shows up in intellisense but won't compile. if I try to use
properties I get an error that says I should try to access get_item
directly but I get a compiler error from that - and it doesn't show up in
intelllisense.
thanks!