Word.BuiltInDocumentProperties("NUMBER OF LINES")

  • Thread starter Thread starter Jeffrey Bradshaw
  • Start date Start date
J

Jeffrey Bradshaw

Hey everybody,
I've got a VB.NET program that is trying to access a Word document and I'm
having all kinds of trouble. First on is the above. I'm trying to get the
number of lines in the document and when I try
docWord.BuiltInDocumentProperties("NUMBER OF LINES") it returns an Object.
When I look in the debugger, it is of type {System.__ComObject} and appears
to have no values. When I get the type - it says the same thing. How can I
get at the actual value?

Are there any good websites about using the office objects in .NET?
Everything I've seen so far seems to be oriented to VBA which is not what
I'm using.

TIA - Jeffrey.
 
Jeffrey,

The way I figured it out was to set up a project with debug and take a look
at the word documents object. Drilling down through the different levels
will be an enlightening experience. Word documents have very complex data
structures.
You might also try writing one out as an XML document and studying it as an
XML text document. Have fun.

Regards
 
Jerry,
Thanks I guess but that doesn't help. I've already been through the debugger
and looked at the assorted properties. BuildInDocumentProperties is of type
System.__ComObject and doesn't appear to have anything in it.

Any help anybody can give would be greatly appreciated.

JB.
 
Jerry,
If you go into the sections object of a Word document, there is no BuildIn
properties type thing (or at least it's not listed in the code window when
you start typing in the sections.)

Any other ideas?

JB.
 
¤ Hey everybody,
¤ I've got a VB.NET program that is trying to access a Word document and I'm
¤ having all kinds of trouble. First on is the above. I'm trying to get the
¤ number of lines in the document and when I try
¤ docWord.BuiltInDocumentProperties("NUMBER OF LINES") it returns an Object.
¤ When I look in the debugger, it is of type {System.__ComObject} and appears
¤ to have no values. When I get the type - it says the same thing. How can I
¤ get at the actual value?
¤

You probably need to specify the Value property:

docWord.BuiltInDocumentProperties("NUMBER OF LINES").Value


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top