I am trying to check properties of a series of Word2000 documents.
For some reason, the Department property is giving me hard time:
<code>
Set objWord = CreateObject("Word.Application")
Set myWdoc = objWord.Documents.Open(myNew)
If myWdoc.CustomDocumentProperties ("Department").Value = Empty Then
</code>
myNew is a valid word document path, I checked it.
It stops at the if statement and gives an "Invalid procedure call or argument" error.
I tried all combinations of .Text instead of .Value or "" instead of Empty, or Null instead of Empty, all at no avail.
This happens when no initial value has been set to the Custome Property 'Department'.
What am I doing wrong, or missing??
______________________________________
Eman2005
Technical User
For some reason, the Department property is giving me hard time:
<code>
Set objWord = CreateObject("Word.Application")
Set myWdoc = objWord.Documents.Open(myNew)
If myWdoc.CustomDocumentProperties ("Department").Value = Empty Then
</code>
myNew is a valid word document path, I checked it.
It stops at the if statement and gives an "Invalid procedure call or argument" error.
I tried all combinations of .Text instead of .Value or "" instead of Empty, or Null instead of Empty, all at no avail.
This happens when no initial value has been set to the Custome Property 'Department'.
What am I doing wrong, or missing??
______________________________________
Eman2005
Technical User