Page 1 of 1

Help Please with OLE Microsoft Word

Posted: Wed May 23, 2007 10:09 am
by xProgrammer
I want to control Word to open Word documents and convert to text format.

I can get the Application object

hWordOle := CreateOleObject("Word.Application")

I can get a ?handle? to the Documents Property

hWordDocs := OleGetProprty( hWordOle, "Documents" )

I can use this to open a file

OleInvoke( hWordDocs, "Open", "d:\pretend\MyDoc.doc" )

I can get a ?handle? to the FileConverters property ( a collection )

ahFileCons := OleGetProperty( hWordOle, "FileConverters" )

but I need to access the mebers of that collection somehow. I don't know how to proceed. I need something like an OleGetPropertyCollection() function.

I need to set the required file converter and then invoke the Save method.

Can anyone help please?

By the way are these Ole functions documented anywhere?

Thanks

Making Progress

Posted: Wed May 23, 2007 12:16 pm
by xProgrammer
I am making progress using

oWord := CREATEOBJECT( "Word.Application" )

then I can find

LEN( oWord:FileConverters )

And iterate through

oWord:FileConverters[liCount]:FormatName

CREATEOBJECT() is undocumented in latest xHarbour documentation as is ToleAuto which might be another approach.

Is there any info out there?

Any opinions as to the best approach?

I am both excited by what xHarbour / Five Win can do and frustrated by the lag of documentation (understandable though it probably is given relatively small user base).

Posted: Wed May 23, 2007 2:24 pm
by RAMESHBABU
Follow this link. You will get some help

http://fivetechsoft.com/forums/viewtopic.php?t=2503


- Ramesh Babu P