copy custom doc. property

W

William

hi,

i have an open word doc. i want to copy custom doc. property from another doc. to the current one. in vba for word xp, how can i do that?

thanks a lot,

william.

--
 
H

Helmut Weber

Hi William,
strictly speaking, you can't copy the property, but
if you want to set the value of a property of an open document
to the value of a property of another document, you could do
it like that:
Dim oDoc1 As Document ' the now active document
Dim oDoc2 As Document ' document to be opened
Set oDoc1 = ActiveDocument
Set oDoc2 = Documents.Open("c:\test\doc-333.doc")
oDoc1.CustomDocumentProperties("CustomProp").Value = _
oDoc2.CustomDocumentProperties("CustomProp").Value
oDoc2.Close
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top