View Single Post
  #5   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Tony Jollans
 
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.