[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Display document properties

Posted on 2009-04-07
13
Medium Priority
?
574 Views
Last Modified: 2013-12-26
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
Comment
Question by:sbsbats
  • 6
  • 6
13 Comments
 
LVL 3

Expert Comment

by:OutOfTouch
ID: 24093749
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
 

Author Comment

by:sbsbats
ID: 24093783
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
 
LVL 3

Expert Comment

by:OutOfTouch
ID: 24093811
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:sbsbats
ID: 24093849
HI,

Nope its 6.5 (Help - about)
Office 2003
error message = Invalid call procedure
0
 
LVL 3

Expert Comment

by:OutOfTouch
ID: 24093882
That is VB 6.0 with service pack 5 installed.
0
 

Author Comment

by:sbsbats
ID: 24093904
Thats great we now agree on the version
0
 
LVL 3

Expert Comment

by:OutOfTouch
ID: 24094010
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
 

Author Comment

by:sbsbats
ID: 24094086
Cheers for that mate but still no go - get the same error message - invalid call to a procedure ...."
0
 
LVL 3

Accepted Solution

by:
OutOfTouch earned 1500 total points
ID: 24094124
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
 
LVL 26

Expert Comment

by:EDDYKT
ID: 24095834
should it be

MsgBox (ActiveDocument.BuiltInDocumentProperties("Category").Value)
0
 
LVL 3

Expert Comment

by:OutOfTouch
ID: 24099525
lol, I didn't realize he didn't have quotes in is code. I should have been paying closer attention, doh. Sorry.
0
 

Author Comment

by:sbsbats
ID: 24101427
sorry guys the above is a typo - I do have the quotes but still no go
0
 

Author Comment

by:sbsbats
ID: 24101472
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question