The code below should create a new document field and remove its code
text. However, in Word 2000 and XP, if the range of the new field
happens to occur inside a table which has its "Text Wrapping" property
set to "Around", the text "T " is always left behind in the field. In
fact, any assignment to the field code's "Text" property appends "T "
to the end of the text assigned.

Has anyone seen this apparent bug before? Does anyone have a solid
workaround? The only workaround I've found is to call "Delete" on the
field's code before assigning a value to its "Text" property.

Thanks.

Re: Word bug editing field text in text-wrapped table by Anne

Anne
Mon Oct 24 09:05:00 CDT 2005

Chris: You forgot to post your code. :)
************
Anne Troy
www.OfficeArticles.com

"Chris Peacock" <chrisp@videss.co.uk> wrote in message
news:1130162478.832714.230480@g47g2000cwa.googlegroups.com...
> The code below should create a new document field and remove its code
> text. However, in Word 2000 and XP, if the range of the new field
> happens to occur inside a table which has its "Text Wrapping" property
> set to "Around", the text "T " is always left behind in the field. In
> fact, any assignment to the field code's "Text" property appends "T "
> to the end of the text assigned.
>
> Has anyone seen this apparent bug before? Does anyone have a solid
> workaround? The only workaround I've found is to call "Delete" on the
> field's code before assigning a value to its "Text" property.
>
> Thanks.
>



Re: Word bug editing field text in text-wrapped table by Chris

Chris
Mon Oct 24 10:02:00 CDT 2005

Oops!!! Thanks. Here goes....

Sub Test()
Dim field As field
Dim rangeField As range
Dim table As table

Set table = Tables(1)
Set rangeField = range(0, 0)
Set field = Fields.Add(rangeField)
field.Code.Text = ""
End Sub