BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Word find-method

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Glenn De Tollenaere
Guest





PostPosted: Tue Sep 28, 2004 12:50 pm    Post subject: Word find-method Reply with quote



Hi all,

I have an application that searches for entries in Worddocuments, eg " " to substitute the text with images. It always worked fine, but suddenly it
does no longer. I use the following code:

....

ole_range:=worddoc.activedocument.range(startposition,endposition);
findtext:=' matchcase:=emptyparam;
matchwholeword:=emptyparam;
matchwildcards:=emptyparam;
matchsoundslike:=emptyparam;
matchallwordforms:=emptyparam;
_forward:=emptyparam;
wrap:=emptyparam;
format:=emptyparam;
replacewith:=emptyparam;
replace:=emptyparam;
while ole_range.find.execute(findtext,
matchcase,
matchwholeword,
matchwildcards,
matchsoundslike,
matchallwordforms,
_forward,
wrap,
format,
replacewith,
replace)
....
The Worddoc-variable in the example above is the Worddocument.

If I check the ole_range variable (debug), it seems to be the correct range
(eg by using ole_range.select I can see the text is correctly selected in
the Worddocument itself). Although everything seems to be correct, the
find-method returns false (and there are entries " text).

Does anyone have any idea what has happened (I guess it has nothing to do
with my application itself, but maybe with a certain setting in Word or
other ?). Or could the Wordversion have anything to do with it (although
that hasn't changed either) ? I do not have the slightest idea why this
find-method returns false (especially because it has always worked for over
more than 2 years).

Any help or suggestion appreciated,

Glenn


Back to top
xtcs
Guest





PostPosted: Tue Sep 28, 2004 2:31 pm    Post subject: Re: Word find-method Reply with quote



Althogh using Range does not have any effect on _forward Param, nevertheless
I'd change _Forward := True.

regards

"Glenn De Tollenaere" <gdt (AT) nospam (DOT) com> wrote

Quote:
Hi all,

I have an application that searches for entries in Worddocuments, eg
" " to substitute the text with images. It always worked fine, but suddenly
it
does no longer. I use the following code:

...

ole_range:=worddoc.activedocument.range(startposition,endposition);
findtext:=' matchcase:=emptyparam;
matchwholeword:=emptyparam;
matchwildcards:=emptyparam;
matchsoundslike:=emptyparam;
matchallwordforms:=emptyparam;
_forward:=emptyparam;
wrap:=emptyparam;
format:=emptyparam;
replacewith:=emptyparam;
replace:=emptyparam;
while ole_range.find.execute(findtext,
matchcase,
matchwholeword,
matchwildcards,
matchsoundslike,
matchallwordforms,
_forward,
wrap,
format,
replacewith,
replace)
...
The Worddoc-variable in the example above is the Worddocument.

If I check the ole_range variable (debug), it seems to be the correct
range
(eg by using ole_range.select I can see the text is correctly selected in
the Worddocument itself). Although everything seems to be correct, the
find-method returns false (and there are entries " text).

Does anyone have any idea what has happened (I guess it has nothing to do
with my application itself, but maybe with a certain setting in Word or
other ?). Or could the Wordversion have anything to do with it (although
that hasn't changed either) ? I do not have the slightest idea why this
find-method returns false (especially because it has always worked for
over
more than 2 years).

Any help or suggestion appreciated,

Glenn





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.