Automation error

A

avarghese

Hi,

When I try to run a macro from Word (Tools->Macros->Run), I'm getting the
following error:
__________________________________________
Run-time error '-2147467259 (80004005)':

Automation error
Unspecified error
__________________________________________

When I debug, it goes to this line of code in my program:
ActiveDocument.CustomDocumentProperties.Add _
Name:="TemplateOpenExclude", LinkToContent:=False, Value:="True", _
Type:=msoPropertyTypeString

I'm using Microsoft Office 2003 Version 11.0, Build 6113.

This code works on other machines with other versions of Word. For eg., I
tried on version 11.5604.6360 and it works. It also works in Word 2002.

Any help is greatly appreciated

Thanks
Al
 
J

Jezebel

You get an error an error additing custom properties if the property already
exists. Safer coding is to delete the property first --

On error resume next
ActiveDocument.CustomDocumentProperties("TemplateOpenExclude").Delete
On error goto 0
ActiveDocument.CustomDocumentProperties.Add ...
 

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