 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Glenn De Tollenaere Guest
|
Posted: Tue Sep 28, 2004 12:50 pm Post subject: Word find-method |
|
|
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
|
Posted: Tue Sep 28, 2004 2:31 pm Post subject: Re: Word find-method |
|
|
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 |
|
 |
|
|
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
|
|