Hi everyone,

Does anyone know if there is a command in VBA that removes a
CustomDocumentProperty? I found a reference in MSDN library about adding a
CustomDocumentProperty but not about removing it as well.

I noticed also that if a property is added manually -that means I go
file->properties->custom- then I can write in my macro
ActiveDocument.CustomDocumentProperties(index).Delete and it is removed. But
if the property is added by my code with a command like this:
ActiveDocument.CustomDocumentProperties.Add xNode.ParentNode.nodeName, False,
msoPropertyTypeString, xNode.NodeValue and then it gets a value with the
command:
ActiveDocument.CustomDocumentProperties.Item(xNode.ParentNode.nodeName).Value
= xNode.NodeValue then I cannot remove this property.

Could anyone please tell me what I am doing wrong?

Re: About CustomDocumentProperties by Jonathan

Jonathan
Thu Jul 21 10:01:35 CDT 2005

There is a Delete method that applies to a CustomDocumentProperty object.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

"Mirka" <Mirka@discussions.microsoft.com> wrote in message
news:C2F80D23-6614-43C3-BE8C-4DBBA3E8BFC5@microsoft.com...
> Hi everyone,
>
> Does anyone know if there is a command in VBA that removes a
> CustomDocumentProperty? I found a reference in MSDN library about adding a
> CustomDocumentProperty but not about removing it as well.
>
> I noticed also that if a property is added manually -that means I go
> file->properties->custom- then I can write in my macro
> ActiveDocument.CustomDocumentProperties(index).Delete and it is removed.
> But
> if the property is added by my code with a command like this:
> ActiveDocument.CustomDocumentProperties.Add xNode.ParentNode.nodeName,
> False,
> msoPropertyTypeString, xNode.NodeValue and then it gets a value with the
> command:
> ActiveDocument.CustomDocumentProperties.Item(xNode.ParentNode.nodeName).Value
> = xNode.NodeValue then I cannot remove this property.
>
> Could anyone please tell me what I am doing wrong?