Board index » delphi » Word & OLE Automation / COM vs OLE

Word & OLE Automation / COM vs OLE

I am trying to get properties from a word file
(such as Title, Author, Summary...)

'Old' OLE way :

  Property :=
WordApp.ActiveDocument.BuiltInDocumentProperties.Item[index].Value

where index is the index of the property (Title = 1 ...)

Now I want to use the 'COM' way, using Word_TLB but Item is not defined
and BuiltInDocumentProperties returns an IDispatch which I am not familiar
to !!

why doesn't Word_TLB go down to the Value an stops at
BuiltInDocumentProperties

what can I do ??

Please Help !

David Gouya

 

Re:Word & OLE Automation / COM vs OLE


Hello,

Try casting as far as BuiltInDocumentProperties as a variant:

variant (blah.blah.BuiltInDocumentProperties).Item [index].Value;

have fun,
--
Binh Ly
Brickhouse Data Systems, Inc.
http://www.brickhouse.com

Quote
David Gouya wrote in message <01bdf840$eb512140$c7c3c3c3@l16>...
>I am trying to get properties from a word file
>(such as Title, Author, Summary...)

>'Old' OLE way :

>  Property :=
>WordApp.ActiveDocument.BuiltInDocumentProperties.Item[index].Value

>where index is the index of the property (Title = 1 ...)

>Now I want to use the 'COM' way, using Word_TLB but Item is not defined
>and BuiltInDocumentProperties returns an IDispatch which I am not familiar
>to !!

>why doesn't Word_TLB go down to the Value an stops at
>BuiltInDocumentProperties

>what can I do ??

>Please Help !

>David Gouya

Other Threads