A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Formatting Long Documents
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problem to find format in word 2003



 
 
Thread Tools Display Modes
  #1  
Old January 3rd, 2006, 05:48 PM posted to microsoft.public.word.formatting.longdocs
external usenet poster
 
Posts: n/a
Default Problem to find format in word 2003

I'm using the FIND object to find formats (Format=TRUE, FinText = ""). My
problem is that in WORD 2003 the method execute to aplied to a find object
return FALSE and i don´t can obtain the new range.
In word 2000 i don´t have this problems the method return TRUE and all is
OK. I'm using the API of word 2003 and the problems continues...

Thank's you.
  #2  
Old January 4th, 2006, 10:01 PM posted to microsoft.public.word.formatting.longdocs
external usenet poster
 
Posts: n/a
Default Problem to find format in word 2003

Can you post the code? How is .Wrap set? Maybe you aren't searching in the
Range you think you are searching (... if you set a breakpoint and select
the range, that should be easy to check)?

Regards,
Klaus


"VN" wrote:
I'm using the FIND object to find formats (Format=TRUE, FinText = "").
My problem is that in WORD 2003 the method execute to aplied to a
find object return FALSE and i don´t can obtain the new range.
In word 2000 i don´t have this problems the method return TRUE and
all is OK. I'm using the API of word 2003 and the problems continues...

Thank's you.



  #3  
Old January 5th, 2006, 08:28 AM posted to microsoft.public.word.formatting.longdocs
external usenet poster
 
Posts: n/a
Default Problem to find format in word 2003

For example with this text: 'This is a text (style bold) with formating.'

Range range(Par.GetRange());
Characters caract(range.GetCharacters());

Range car = caract.Item(longcar);

Find buscar(car.GetFind());

COleVariant FindText;
FindText = "";
COleVariant MatchCase;
MatchCase = (short)FALSE;
COleVariant MatchWholeWord;
MatchWholeWord = (short)FALSE;
COleVariant MatchWildcards;
MatchWildcards = (short)FALSE;
COleVariant MatchSoundsLike;
MatchSoundsLike = (short)FALSE;
COleVariant MatchAllWordForms;
MatchAllWordForms = (short)FALSE;
COleVariant Forward;
Forward = (short)TRUE;
COleVariant Wrap;
Wrap = (short)wdFindStop;
COleVariant Format;
Format = (short)TRUE;
COleVariant ReplaceWith;
ReplaceWith = "";
COleVariant Replace;
Replace = (short)wdReplaceNone;

BOOL resul = buscar.Execute(
&FindText,
&MatchCase,
&MatchWholeWord,
&MatchWildcards,
&MatchSoundsLike,
&MatchAllWordForms,
&Forward,
&Wrap,
&Format,
&ReplaceWith,
&Replace);

if the document is in word 2000 resul = TRUE and the function
car.GetText() return the string 'his is a text ' and all is ok, but if the
document is save with word 2002 0r 2003, resul = FALSE and the funtion
car.GetText() return the char 't' .....

Regards,
VN.

"Klaus Linke" escribió:

Can you post the code? How is .Wrap set? Maybe you aren't searching in the
Range you think you are searching (... if you set a breakpoint and select
the range, that should be easy to check)?

Regards,
Klaus


"VN" wrote:
I'm using the FIND object to find formats (Format=TRUE, FinText = "").
My problem is that in WORD 2003 the method execute to aplied to a
find object return FALSE and i don´t can obtain the new range.
In word 2000 i don´t have this problems the method return TRUE and
all is OK. I'm using the API of word 2003 and the problems continues...

Thank's you.




  #4  
Old January 9th, 2006, 01:23 AM posted to microsoft.public.word.formatting.longdocs
external usenet poster
 
Posts: n/a
Default Problem to find format in word 2003

It's unlikely that there is a new bug in Find... Maybe something else is
going wrong?
Are you sure the document is opened as a formatted document, and not as a
text file (i.e., can you see the file when it's opened)?

There have been some changes in the VBA for opening files from 2000 to
2002/2003, but no changes in Find that I am aware of.

BTW, maybe better collapse the range before the search? Your code depends on
the fact that Word skips the Range if it completely matches the search
criteria, and immediately continues searching downwards. It may be better to
make the code independent of such things.

Regards,
Klaus



"VN" schrieb:
For example with this text: 'This is a text (style bold) with formating.'

Range range(Par.GetRange());
Characters caract(range.GetCharacters());

Range car = caract.Item(longcar);

Find buscar(car.GetFind());

COleVariant FindText;
FindText = "";
COleVariant MatchCase;
MatchCase = (short)FALSE;
COleVariant MatchWholeWord;
MatchWholeWord = (short)FALSE;
COleVariant MatchWildcards;
MatchWildcards = (short)FALSE;
COleVariant MatchSoundsLike;
MatchSoundsLike = (short)FALSE;
COleVariant MatchAllWordForms;
MatchAllWordForms = (short)FALSE;
COleVariant Forward;
Forward = (short)TRUE;
COleVariant Wrap;
Wrap = (short)wdFindStop;
COleVariant Format;
Format = (short)TRUE;
COleVariant ReplaceWith;
ReplaceWith = "";
COleVariant Replace;
Replace = (short)wdReplaceNone;

BOOL resul = buscar.Execute(
&FindText,
&MatchCase,
&MatchWholeWord,
&MatchWildcards,
&MatchSoundsLike,
&MatchAllWordForms,
&Forward,
&Wrap,
&Format,
&ReplaceWith,
&Replace);

if the document is in word 2000 resul = TRUE and the function
car.GetText() return the string 'his is a text ' and all is ok, but if the
document is save with word 2002 0r 2003, resul = FALSE and the funtion
car.GetText() return the char 't' .....

Regards,
VN.

"Klaus Linke" escribió:

Can you post the code? How is .Wrap set? Maybe you aren't searching in
the
Range you think you are searching (... if you set a breakpoint and select
the range, that should be easy to check)?

Regards,
Klaus


"VN" wrote:
I'm using the FIND object to find formats (Format=TRUE, FinText = "").
My problem is that in WORD 2003 the method execute to aplied to a
find object return FALSE and i don´t can obtain the new range.
In word 2000 i don´t have this problems the method return TRUE and
all is OK. I'm using the API of word 2003 and the problems continues...

Thank's you.






  #5  
Old January 9th, 2006, 11:09 AM posted to microsoft.public.word.formatting.longdocs
external usenet poster
 
Posts: n/a
Default Problem to find format in word 2003

Where in this code are you saying that you want to find Bold text?

The Find object is persistent. When you don't specify something explicitly,
any previous setting remains in effect.

You should always be explicit in code, and need to add "Find.Font.Bold =
True" (or the equivalent in whatever language this is) to the execution.

--
Enjoy,
Tony


"VN" wrote in message
...
For example with this text: 'This is a text (style bold) with formating.'

Range range(Par.GetRange());
Characters caract(range.GetCharacters());

Range car = caract.Item(longcar);

Find buscar(car.GetFind());

COleVariant FindText;
FindText = "";
COleVariant MatchCase;
MatchCase = (short)FALSE;
COleVariant MatchWholeWord;
MatchWholeWord = (short)FALSE;
COleVariant MatchWildcards;
MatchWildcards = (short)FALSE;
COleVariant MatchSoundsLike;
MatchSoundsLike = (short)FALSE;
COleVariant MatchAllWordForms;
MatchAllWordForms = (short)FALSE;
COleVariant Forward;
Forward = (short)TRUE;
COleVariant Wrap;
Wrap = (short)wdFindStop;
COleVariant Format;
Format = (short)TRUE;
COleVariant ReplaceWith;
ReplaceWith = "";
COleVariant Replace;
Replace = (short)wdReplaceNone;

BOOL resul = buscar.Execute(
&FindText,
&MatchCase,
&MatchWholeWord,
&MatchWildcards,
&MatchSoundsLike,
&MatchAllWordForms,
&Forward,
&Wrap,
&Format,
&ReplaceWith,
&Replace);

if the document is in word 2000 resul = TRUE and the function
car.GetText() return the string 'his is a text ' and all is ok, but if the
document is save with word 2002 0r 2003, resul = FALSE and the funtion
car.GetText() return the char 't' .....

Regards,
VN.

"Klaus Linke" escribió:

Can you post the code? How is .Wrap set? Maybe you aren't searching in

the
Range you think you are searching (... if you set a breakpoint and

select
the range, that should be easy to check)?

Regards,
Klaus


"VN" wrote:
I'm using the FIND object to find formats (Format=TRUE, FinText = "").
My problem is that in WORD 2003 the method execute to aplied to a
find object return FALSE and i don´t can obtain the new range.
In word 2000 i don´t have this problems the method return TRUE and
all is OK. I'm using the API of word 2003 and the problems

continues...

Thank's you.






  #6  
Old January 10th, 2006, 11:52 AM posted to microsoft.public.word.formatting.longdocs
external usenet poster
 
Posts: n/a
Default Problem to find format in word 2003

But i need to find i change of style (not only bold... underline,....) and
with the flag Format = (short)TRUE; and FindText = ""; i think that is
enought. In word 2000 runs ok but in word 2002 or 2003 is wrong; maybe in the
open is the different i'm tested that the document is open as a formatted
document....

Thanks.

"Tony Jollans" escribió:

Where in this code are you saying that you want to find Bold text?

The Find object is persistent. When you don't specify something explicitly,
any previous setting remains in effect.

You should always be explicit in code, and need to add "Find.Font.Bold =
True" (or the equivalent in whatever language this is) to the execution.

--
Enjoy,
Tony


"VN" wrote in message
...
For example with this text: 'This is a text (style bold) with formating.'

Range range(Par.GetRange());
Characters caract(range.GetCharacters());

Range car = caract.Item(longcar);

Find buscar(car.GetFind());

COleVariant FindText;
FindText = "";
COleVariant MatchCase;
MatchCase = (short)FALSE;
COleVariant MatchWholeWord;
MatchWholeWord = (short)FALSE;
COleVariant MatchWildcards;
MatchWildcards = (short)FALSE;
COleVariant MatchSoundsLike;
MatchSoundsLike = (short)FALSE;
COleVariant MatchAllWordForms;
MatchAllWordForms = (short)FALSE;
COleVariant Forward;
Forward = (short)TRUE;
COleVariant Wrap;
Wrap = (short)wdFindStop;
COleVariant Format;
Format = (short)TRUE;
COleVariant ReplaceWith;
ReplaceWith = "";
COleVariant Replace;
Replace = (short)wdReplaceNone;

BOOL resul = buscar.Execute(
&FindText,
&MatchCase,
&MatchWholeWord,
&MatchWildcards,
&MatchSoundsLike,
&MatchAllWordForms,
&Forward,
&Wrap,
&Format,
&ReplaceWith,
&Replace);

if the document is in word 2000 resul = TRUE and the function
car.GetText() return the string 'his is a text ' and all is ok, but if the
document is save with word 2002 0r 2003, resul = FALSE and the funtion
car.GetText() return the char 't' .....

Regards,
VN.

"Klaus Linke" escribió:

Can you post the code? How is .Wrap set? Maybe you aren't searching in

the
Range you think you are searching (... if you set a breakpoint and

select
the range, that should be easy to check)?

Regards,
Klaus


"VN" wrote:
I'm using the FIND object to find formats (Format=TRUE, FinText = "").
My problem is that in WORD 2003 the method execute to aplied to a
find object return FALSE and i don´t can obtain the new range.
In word 2000 i don´t have this problems the method return TRUE and
all is OK. I'm using the API of word 2003 and the problems

continues...

Thank's you.






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't see email images using Word 2003 and Outlook 2003 xfile New Users 0 December 24th, 2005 03:23 AM
Word applies direct format on File open Uriel General Discussion 16 November 27th, 2005 07:22 PM
Word 97 in Windows XP to maintain formatting Charlie''s Word VBA questions General Discussion 21 October 24th, 2005 09:49 PM
Mail Merge date format problem with Word 2003 Thang New Users 1 May 2nd, 2005 01:55 PM
find and replace ladyinred General Discussion 14 August 12th, 2004 09:35 PM


All times are GMT +1. The time now is 11:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.