You mean that you're running the code in Outlook VBA? That shouldn't make any difference, since it's using the same object library as Word VBA. I think you could improve the code, though, by using an explicit reference to the document, rather than ActiveDocument. Since the document isn't displayed, maybe Word isn't treating it as active:
Set wrd = CreateObject("Word.Application")
strFile = "whatever yoiu named it.dot"
Set objDoc = wrd.Documents.Open (strFile)
With objDoc
.CustomDocumentProperties("BI_NAME").Delete
.CustomDocumentProperties.Add "BI_NAME", 0, 4, "Rigoletto Eikenberg"
.Save
.Close
End With

Signature
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
Rigoletto Eikenberg - 18 Dec 2003 13:55 GMT
Now i got it work. Thanks for your help.
When it is finished i will public it.
Rigoletto
You mean that you're running the code in Outlook VBA? That shouldn't make
any difference, since it's using the same object library as Word VBA. I
think you could improve the code, though, by using an explicit reference to
the document, rather than ActiveDocument. Since the document isn't
displayed, maybe Word isn't treating it as active:
Set wrd = CreateObject("Word.Application")
strFile = "whatever yoiu named it.dot"
Set objDoc = wrd.Documents.Open (strFile)
With objDoc
.CustomDocumentProperties("BI_NAME").Delete
.CustomDocumentProperties.Add "BI_NAME", 0, 4, "Rigoletto Eikenberg"
.Save
.Close
End With
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx