• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 576
  • Last Modified:

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?
0
sbsbats
Asked:
sbsbats
  • 6
  • 6
1 Solution
 
OutOfTouchCommented:
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
 
0
 
sbsbatsAuthor Commented:
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
0
 
OutOfTouchCommented:
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.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
sbsbatsAuthor Commented:
HI,

Nope its 6.5 (Help - about)
Office 2003
error message = Invalid call procedure
0
 
OutOfTouchCommented:
That is VB 6.0 with service pack 5 installed.
0
 
sbsbatsAuthor Commented:
Thats great we now agree on the version
0
 
OutOfTouchCommented:
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.
0
 
sbsbatsAuthor Commented:
Cheers for that mate but still no go - get the same error message - invalid call to a procedure ...."
0
 
OutOfTouchCommented:
You could try this to see if the category is property is there:
 For Each prop In doc.BuiltInDocumentProperties
        On Error Resume Next
        WriteLine " " & prop.Name & " = " & prop.Value
Next
 
0
 
EDDYKTCommented:
should it be

MsgBox (ActiveDocument.BuiltInDocumentProperties("Category").Value)
0
 
OutOfTouchCommented:
lol, I didn't realize he didn't have quotes in is code. I should have been paying closer attention, doh. Sorry.
0
 
sbsbatsAuthor Commented:
sorry guys the above is a typo - I do have the quotes but still no go
0
 
sbsbatsAuthor Commented:
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
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now