Solved

Display document properties

Posted on 2009-04-07
13
569 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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 500 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…

738 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