Help Please with OLE Microsoft Word

Post Reply
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Help Please with OLE Microsoft Word

Post 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
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Making Progress

Post 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).
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Post by RAMESHBABU »

Follow this link. You will get some help

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


- Ramesh Babu P
Post Reply