Winword and OLE

Re: Winword and OLE

Postby fp » 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
User avatar
fp
 
Posts: 76
Joined: Fri Dec 30, 2005 10:25 am
Location: Germany

Re: Winword and OLE

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Winword and OLE

Postby fp » 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
User avatar
fp
 
Posts: 76
Joined: Fri Dec 30, 2005 10:25 am
Location: Germany

Re: Winword and OLE

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Winword and OLE

Postby fp » Sat Jun 08, 2013 12:03 pm

Hello Enrico,

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

Thanks
Frank-Peter
User avatar
fp
 
Posts: 76
Joined: Fri Dec 30, 2005 10:25 am
Location: Germany

Re: Winword and OLE

Postby Enrico Maria Giordano » Sat Jun 08, 2013 5: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
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Winword and OLE

Postby fp » Sat Jun 08, 2013 6: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
User avatar
fp
 
Posts: 76
Joined: Fri Dec 30, 2005 10:25 am
Location: Germany

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 104 guests