Problem with WORD (Find/Replace)

Post Reply
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Problem with WORD (Find/Replace)

Post by Romeo »

Hi all,

I am using the version FWH 16.02 but i got problem with WORD. My previous version of FWH (8.10) does not have this problem and works very well !!

This simple program does not work with versione FWH 16.02:

function main()
local _cfile:=HB_curdrive()+":\"+curdir()+"\test.doc"
local _oword,_oDoc,_oText,_oFind,_lex,_cfound

_oWord :=TOleAuto():New( "Word.Application" )
_oDoc :=_oWord:Get( "Documents" )
_oWord:Set("Visible",.f.) && HERE I START TO HAVE ERRORs
_oDoc:Open(_cFile )
_oText:=_oWord:Selection()
_oFind:=_oText:Find()
_oFind:Text:="#*#"
_oFind:Wrap:=1
_oFind:Set("MatchWildcards",.t.)
_oFind:Execute()
_lex:="#" $ _oText:Text
_cFound:=alltrim(SubStr(_oText:Text,2,Len(Alltrim(_oText:Text))-2))
if ! empty(_cfound)
msginfo("Found: "+_cFound)
else
msginfo("Not Found !")
endif
_oDoc:Close( 0 )
_oWord:quit()
return nil

****
THIS IS THE SIMPLE FILE .doc:

**start doc

Ciao io sono il sig.#ROSSI MARIO#

** end file doc


MANY, MANY THANKS FOR HELP, HELP !!

Romeo
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Problem with WORD (Find/Replace)

Post by Enrico Maria Giordano »

As I advised you in private mail, it's one of the many Harbour bugs. You have to replace this

Code: Select all

_oWord:Set("Visible",.f.)
with this

Code: Select all

_oWord:Visible = .f.
and this

Code: Select all

_oFind:Set("MatchWildcards",.t.)
with this

Code: Select all

_oFind:MatchWildcards = .t.
EMG
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Post by Romeo »

Great Enrico,

i go ahead, but i got error when use:

_oText:TypeText( _cvar )

Have i to change also this ?

tks
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Problem with WORD (Find/Replace)

Post by Enrico Maria Giordano »

Romeo wrote:Great Enrico,

i go ahead, but i got error when use:

_oText:TypeText( _cvar )

Have i to change also this ?

tks
This is not in your sample.

EMG
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Post by Romeo »

There are also other istructions, i am finding where is the problem.

I let you know

tks
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Post by Romeo »

In the above sample, if my doc is:

*******

Ciao io sono il sig.#ROSSI "di" MARIO#

*******

the istruction of my sample:

_cFound:=alltrim(SubStr(_oText:Text,2,Len(Alltrim(_oText:Text))-2))

gives me:

ROSSI ?di? MARIO instead of ROSSI "di" MARIO

It is a problem for me, and i don't understand the reason,

All works fine in my old version of FWH 8.10 (HARBOUR)

The problem happens only on the earler version FWH 16.01 (HARBOUR)

tks for any help
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Problem with WORD (Find/Replace)

Post by Enrico Maria Giordano »

I just tried and worked fine here (latest FWH and xHarbour). Tried with Harbour also: no problems.

EMG
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Post by Romeo »

It is a bug of my FWH 16.02 !

Antonio, any patch for me ?

tks
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Problem with WORD (Find/Replace)

Post by Enrico Maria Giordano »

Romeo wrote:It is a bug of my FWH 16.02 !
Don't think so. It is more likely that you are using wide chars for double quotes instead of the ASCII ones.

EMG
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Post by Romeo »

Ops !

EMG found the error, but cannot resolve it.

He suggest me to post it here

Please download this very sample program e try why i get the problem !!


http://www.modularsoftware.it/~connetti ... eplace.zip


BCC: 7.2
HARBOUR 3.2.0dev (r1603082110)
FWH: 16,02

many thanks to all
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Post by Romeo »

Please, nobody can helps me ??

The example is very sample !!

tks
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with WORD (Find/Replace)

Post by Silvio.Falconi »

But if there is a bug on Harbour is good to found it soon or advise Harbour Team
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Romeo
Posts: 328
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Post by Romeo »

As also Linares confirmed me, there is a bug in Harbour...

I have wrotye to harbour group
(https://groups.google.com/forum/#!newto ... bour-users)

And also they said me: there is a bug in Harbour (!), but non in xHarbour

I'am waiting sameone resolve it..

I'm praying to all the saints and I hope someone fixs the bug, otherwise I'm in very bad trouble with my clients ;-(

R
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with WORD (Find/Replace)

Post by Silvio.Falconi »

I hope you solve your problems soon

But I'm convinced, given my experience in this forum and google forums and others

that if the topic is of personal interest nobody will try to solve the problem,

but if the subject is of general interest then you will see that some important guru will be beautiful in the chicken coop !!!
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply