T
Tony Strazzeri
Hi Folks,
I thought I would post this for reference as it wasted several hours of
my time before I came to the realisation that it was a Word Bug.
I have a procedure that searched for a particular character style.
When it finds the style it expands the selection by two characters
which if the selection is inside a MacroButton field causes the field
to be selected.
The procedure can then check the Fields.Count to find out if the text
was inside the field.
The problem I discovered is that if the text to be found is on a
paragraph that is followed by a table, the find will not find/select
the entire text formatted in the specified style. For some obscure
reason it fails to select the last two characters of the formatted
text. The effect of this is that when the above-mentioned expansion
(of the selected text) is done it of course is not enough to enable the
field to be properly selected and therefore the Fields.Count returns
zero.
I played around with cut and paste, recreating the MacroButton field
and reapplying the character style to no avail. IT IS A BUG.
Any text inside fields prior to the last field in the paragraph before
the table is selected correctly but not in the last field on the
paragraph.
I am interested to know if anyone has come across this problem before.
Cheers
TonyS.
I thought I would post this for reference as it wasted several hours of
my time before I came to the realisation that it was a Word Bug.
I have a procedure that searched for a particular character style.
When it finds the style it expands the selection by two characters
which if the selection is inside a MacroButton field causes the field
to be selected.
The procedure can then check the Fields.Count to find out if the text
was inside the field.
The problem I discovered is that if the text to be found is on a
paragraph that is followed by a table, the find will not find/select
the entire text formatted in the specified style. For some obscure
reason it fails to select the last two characters of the formatted
text. The effect of this is that when the above-mentioned expansion
(of the selected text) is done it of course is not enough to enable the
field to be properly selected and therefore the Fields.Count returns
zero.
I played around with cut and paste, recreating the MacroButton field
and reapplying the character style to no avail. IT IS A BUG.
Any text inside fields prior to the last field in the paragraph before
the table is selected correctly but not in the last field on the
paragraph.
I am interested to know if anyone has come across this problem before.
Cheers
TonyS.