kourosh saleh

kourosh saleh

  • NA
  • 20
  • 50k

deleteing CustomDocumentProperties

May 12 2006 9:59 AM
Hi,

I am trying to delete  CustomDocumentProperties but by using following code:

object[] TheArgs = new object[] { PropName, false, 
MsoDocProperties.msoPropertyTypeString, PropValue };

TypeOfAllCustomProps.InvokeMember("Delete", BindingFlags.Default | 
BindingFlags.InvokeMethod, null, AllCustomProps, TheArgs);

I get this error: 
System.Runtime.InteropSerive.COMException (0X80020006): Unknown name. 
(Exception from HRESULT: .....
at Sytem.RuntimeType.InvokeDispMethod(string name, BindingFlags 
invokeAttr,....


somewhere i saw that you can use CustomDocumentProperties.Remove.
But it is not right. 

thank you for your help