To see this issue create a single row two column table and insert text
formfield in the first cell and and a REF to that formfield in the second
cell. Protect the document and add some text to the formfield.

Run this code:

Sub DumbfoundedI()
Dim oTbl As Table
Set oTbl = ActiveDocument.Tables(1)
MsgBox oTbl.Range.Fields.Count
MsgBox ActiveDocument.Fields.Count
oTbl.Range.Fields.Update

The message box proves that there are two fields in the table and in the
activedocument yet the REF field doesn't update. Does anyone know why?

However, if I run either of the following procedures the REF field does
update:

Sub DumbfoundedII()
ActiveDocument.Fields.Update
End Sub

or

Sub DumbfoundedII()
Dim oTbl As Table
Dim oFld As Field
Set oTbl = ActiveDocument.Tables(1)
For Each oFld In oTbl.Range.Fields
oFld.Update
Next oFld
End Sub

or:

Sub DumbfoundedIV()
Dim oTbl As Table
Dim oRng As Range
Set oTbl = ActiveDocument.Tables(1)
Set oRng = oTbl.Range
oRng.Start = oRng.Start + 1
oRng.End = oRng.End + 1
oRng.Fields.Update
End Sub



--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Re: Oddity with Field Update in a protected form Table by David

David
Tue Jan 22 08:15:09 PST 2008

Appears to be a bug, err, feature.

http://support.microsoft.com/kb/176717/en-us

While the title is about dropdowns, the language of the article seems
to refer to all formfields.

This fix seems to work on your example.

Re: Oddity with Field Update in a protected form Table by Greg

Greg
Tue Jan 22 09:23:23 PST 2008

David,

While I wasn't aware of that KB article, I was aware that I didn't see the
behaviour if I used "Calculate on exit." I my real problem is with a bigger
form that I am working on. In that form, I am creating new rows in a
protected form that contains text and calculation formfields.

I don't know why, but calculate on exit fails (I think because my on exit
macro takes over) and the fields aren't updated. I can send you a copy of
the file if you want to have a peek.

You can reach me through the "Contact Me" link on my website.

Thanks.


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


David Sisson wrote:
> Appears to be a bug, err, feature.
>
> http://support.microsoft.com/kb/176717/en-us
>
> While the title is about dropdowns, the language of the article seems
> to refer to all formfields.
>
> This fix seems to work on your example.



Re: Oddity with Field Update in a protected form Table by David

David
Tue Jan 22 10:28:50 PST 2008

On Jan 22, 11:23=A0am, "Greg Maxey" <gma...@mvps.oSCARrOMEOgOLF> wrote:
> I don't know why, but calculate on exit fails (I think because my on exit
> macro takes over) and the fields aren't updated. =A0I can send you a copy =
of
> the file if you want to have a peek.
>
Interesting...

I've requested that file via the web site.

David