Board index » delphi » Ole Automation with Word 97 (8.0)

Ole Automation with Word 97 (8.0)

Hi!

This is my first time in this newsgroup, my english is terrible, but I have
a big heart... or its a big head |-).
I have a trouble with Ole automation in Word 97 + Delphi 3.02.
The trouble is with the WordBasic method
'ActiveDocument.BuiltInDocumentProperties(14)', in runtime the program say
me that 'BuiltInDocumentProperties is not a method'. I try to use the form
'ActiveDocument.BuiltInDocumentProperties.Item(14)' and nothing.
Other WordBasic methods works fine, I try this method in Word VBA editor and
Work fine too.

What's the matter?

Another question I need the Word Basic 97 constants, Where can I find It ?

Thanks to all.

Asier Zubillaga
DUOK Informtica y Comunicaciones.

 

Re:Ole Automation with Word 97 (8.0)


Quote
In article <6mpa6m$1c...@diana.bcn.ibernet.es>, "Asier Zubillaga" <asierz...@jet.es> wrote:
>Hi!
>This is my first time in this newsgroup, my english is terrible, but I have
>a big heart... or its a big head |-).
>I have a trouble with Ole automation in Word 97 + Delphi 3.02.
>The trouble is with the WordBasic method
>'ActiveDocument.BuiltInDocumentProperties(14)', in runtime the program say
>me that 'BuiltInDocumentProperties is not a method'. I try to use the form
>'ActiveDocument.BuiltInDocumentProperties.Item(14)' and nothing.
>Other WordBasic methods works fine, I try this method in Word VBA editor and
>Work fine too.
>What's the matter?

I don't know the OLE bridge off by heart, but there's one thing definitely to
note if you're looking at a VBA reference - is that if you are dealing with a
property array, you need to use the Delphi syntax for an array.

If what I suspect is true, your problems will clear up if you use either the
syntax:
  ActiveDocument.BuiltInDocumentProperties[14]
(note the square brackets)
OR
  ActiveDocument.BuiltInDocumentProperties.Items[14]
(I don't know if there's such a thing as default property arrays for OLE)

Quote
>Another question I need the Word Basic 97 constants, Where can I find It ?

I don't know if this sort of thing would be contained in the Word 97 type
library, but there might be some enums in there.  Try importing the Word 97
type libary and see what it gives you.

  --=- Ritchie Annand

Other Threads