Board index » delphi » Using Word Object Library from Delphi...

Using Word Object Library from Delphi...

I was wondering how I could use the Word object library that comes with
office.  I'd like to generate and print some Word documents and it would be
nice to see the Word classes so I could generate the objects necessary to
do so.  Any ideas?

Todd Rogers

 

Re:Using Word Object Library from Delphi...


Todd Rogers <removethis_roger...@pipeline.com> wrote in article
<01bc68d3$e2e86340$56091b26@marsha>...

Quote
> I was wondering how I could use the Word object library that comes with
> office.  I'd like to generate and print some Word documents and it would
be
> nice to see the Word classes so I could generate the objects necessary to
> do so.  Any ideas?

> Todd Rogers

OK, I figured out how to create the OLE object but I can't do anything with
it.  I'm using Word 97 and the examples in Delphi help do not work outside
of just creating the object itself.  Looking through the object inspector
in VB for Word, I don't know what this line actually creates:

  MSWord := CreateOleObject('Word.Basic');

Is it a Document object or an Application object or something else?

Re:Using Word Object Library from Delphi...


OK, so it was really late when I was working on this, but I figured out the
problem.  When I was creating the OLE object, I was doing it wrong.
Instead of:

MSWord := CreateOleObject('Word.Basic');

I should have used:

MSWord := CreateOleObject('Word.Application.8');

This creates a Word97 Application object, not a word 95 one.  Sorry for so
many posts to myself!

Todd

Other Threads