FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH and Word - OLE
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM

FWH and Word - OLE

Posted: Tue Feb 03, 2015 09:04 AM

Hello,

Suppose I have a Word-document in RTF (extension RTF) and I want to transfer it to a Word 1997-2003 document (extension DOC), how can it be done using OLE?

Thanks.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: FWH and Word - OLE

Posted: Tue Feb 03, 2015 09:16 AM
Michel,

Code (fw): Select all Collapse
oSel = oDoc:Windows[ 1 ]:Selection

oSel:InsertFile( cRtf, OLEDEFAULTARG(), .F. )

// Now go on with normal OLE Word stuff (ie. oDoc:SaveAs( cDoc ))


EMG
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM

Re: FWH and Word - OLE

Posted: Tue Feb 03, 2015 09:54 AM

Enrico,

I think you misunderstood my question.

In my application, I open a RTF-file in Word, using OLE. Then I want my application to save it as a Word 1997-2003 document.

The solution you suggested (I think) inserts a rtf-file into a Word-document, doesn't it?

Thanks.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: FWH and Word - OLE

Posted: Tue Feb 03, 2015 10:10 AM
Michel,

unfortunately, it looks like it can't be done:

Code (fw): Select all Collapse
#define wdFormatDocument 0
#define wdFormatDocument97 0

oDoc:SaveAs( cDoc, wdFormatDocument97 )


As you can see, wdFormatDocument and wdFormatDocument97 have the same value... :-)

EMG
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM

Re: FWH and Word - OLE - Solved

Posted: Tue Feb 03, 2015 10:40 AM

Enrico,

Thank you so much.

Problem solved.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Re: FWH and Word - OLE - Solved

Posted: Tue Feb 03, 2015 03:06 PM

Michel,

Please tell us how you solved the problem.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM

Re: FWH and Word - OLE

Posted: Tue Feb 03, 2015 11:45 PM

James,

I thought that my problem was solved by using the Enrico's suggestion.

Unfortunately, I have still one problem left.

If I test it on my PC (Windows 7 with Office 2010 of Office 2013), everything runs just fine.

But at one of my customers, using Windows 8.1 and Office 2013, a dialog box in Word is shown, just if I have used the function "Save as" in Word. Why is that dialog box in Word appearing?

Thanks.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: FWH and Word - OLE

Posted: Wed Feb 04, 2015 09:19 AM
driessen wrote:But at one of my customers, using Windows 8.1 and Office 2013, a dialog box in Word is shown, just if I have used the function "Save as" in Word. Why is that dialog box in Word appearing?


Maybe they haven't installed the filter (or what is named) for older DOC format?

EMG
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM

Re: FWH and Word - OLE

Posted: Wed Feb 04, 2015 01:01 PM

Enrico,

My customer can save documents in Word 1997-2003 format manually without any problem.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: FWH and Word - OLE

Posted: Wed Feb 04, 2015 01:12 PM

Michel,

sorry, I have no more ideas... :-(

EMG

Continue the discussion