FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Winword and OLE
Posts: 76
Joined: Fri Dec 30, 2005 10:25 AM
Re: Winword and OLE
Posted: Sat Jun 08, 2013 10:19 AM

Hallo Enrico,

thanks. Your sample works, but furthermore only in the first frame of a document.

Is there a way to scan all frames of a document and replace something?

Tank

Frank-Peter
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Winword and OLE
Posted: Sat Jun 08, 2013 10:39 AM
Frank,

fp wrote:Hallo Enrico,

thanks. Your sample works, but furthermore only in the first frame of a document.

Is there a way to scan all frames of a document and replace something?

Tank


My sample has a loop that should serve to replace each frames. I don't understand why it doesn't work for you. Have you double check the parameters you are passing to the function? Anyway, I used it in a real application and it was working fine.

EMG
Posts: 76
Joined: Fri Dec 30, 2005 10:25 AM
Re: Winword and OLE
Posted: Sat Jun 08, 2013 11:39 AM

Hello Enrico,

sorry, but your code only checks the first frame with me.

your first
oRng := oDoc:StoryRanges[wdTextFrameStory]

returns in oRng:Text only the content of the first frame, not of the others.

And if cSrc is not in oRng:Text, then "AT(cSrc,cRng:Text) > 0" is false and the function exit before "looping".

Nevertheless, many thanks for your efforts

Frank-Peter
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Winword and OLE
Posted: Sat Jun 08, 2013 11:43 AM
Frank,

fp wrote:Hello Enrico,

sorry, but your code only checks the first frame with me.

your first
oRng := oDoc:StoryRanges[wdTextFrameStory]

returns in oRng:Text only the content of the first frame, not of the others.

And if cSrc is not in oRng:Text, then "AT(cSrc,cRng:Text) > 0" is false and the function exit before "looping".

Nevertheless, many thanks for your efforts


Please send me the DOC (Word 2000) so I can test it here.

EMG
Posts: 76
Joined: Fri Dec 30, 2005 10:25 AM
Re: Winword and OLE
Posted: Sat Jun 08, 2013 12:03 PM

Hello Enrico,

I've just sent the doc to your private mail-adress.

Thanks

Frank-Peter
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Winword and OLE
Posted: Sat Jun 08, 2013 05:49 PM
Frank,

fp wrote:Hello Enrico,

I've just sent the doc to your private mail-adress.

Thanks


Your document has something wrong. I tried with a new document and it works fine. I've just sent a working sample to your private email.

EMG
Posts: 76
Joined: Fri Dec 30, 2005 10:25 AM
Re: Winword and OLE
Posted: Sat Jun 08, 2013 06:30 PM

Thank you Enrico,

your sample works well. Maybe my dokument contains to much frames and / or bitmaps in frames. I will check it.

Frank-Peter

Continue the discussion