Link to home
Start Free TrialLog in
Avatar of sbsbats
sbsbatsFlag for New Zealand

asked on

Display document properties

I am trying to display a property (Category property) of a word document in a message box using this code -
MsgBox (ActiveDocument.BuiltInDocumentProperties(Category).Value)

Geting an invalid call procedure error
Any suggestions?
Avatar of OutOfTouch
OutOfTouch
Flag of United States of America image

What version of VB or flavor of VB are you using?
This might help:
http://www.vb-helper.com/howto_show_word_builtin_properties.html
 
Avatar of sbsbats

ASKER

VB 6.5
Shouldn't ActiveDocument.BuiltInDocumentProperties(Category).Value - return the property value?

The code above dosn't help me - I am writing the properties to the document already through a form and was just wondering why this syntax is incorrect
Do you mean that your using VB 6.0?
I forgot to ask you what version of MS Word you are using and what the error message is.
Avatar of sbsbats

ASKER

HI,

Nope its 6.5 (Help - about)
Office 2003
error message = Invalid call procedure
That is VB 6.0 with service pack 5 installed.
Avatar of sbsbats

ASKER

Thats great we now agree on the version
Unfortunately I don't have VB 6.0 on my dev box anymore, so I can't garauantee that this will work.
Try this wdPropertyCategory where you have category in your code above.
Avatar of sbsbats

ASKER

Cheers for that mate but still no go - get the same error message - invalid call to a procedure ...."
ASKER CERTIFIED SOLUTION
Avatar of OutOfTouch
OutOfTouch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
should it be

MsgBox (ActiveDocument.BuiltInDocumentProperties("Category").Value)
lol, I didn't realize he didn't have quotes in is code. I should have been paying closer attention, doh. Sorry.
Avatar of sbsbats

ASKER

sorry guys the above is a typo - I do have the quotes but still no go
Avatar of sbsbats

ASKER

HI,

Thanks for all the help - I was using the custom properties (CustomDocumentProperties) procedure for existing properties and the above (built in properties) to access custom properties - silly