I use "ActiveDocument.Fields.Add Range:=..." all over the document and it
works fine. When the range is myTbl.Columns(1).Cells(1).Range I get "Runtime
error '4605' This command is not available". What am I doing wrong please?

RE: How to insert a field in a table cell by ChuckHenrich

ChuckHenrich
Wed Aug 17 10:38:13 CDT 2005

The table cell range includes the table cell marker. You need to exclude
that by collapsing the range or moving the end eg:

Dim rngRange As Range

Set rngRange = ActiveDocument.Tables(1).Columns(1).Cells(1).Range
rngRange.Collapse wdCollapseStart
ActiveDocument.Fields.Add rngRange, wdFieldDate

or

Dim rngRange As Range

Set rngRange = ActiveDocument.Tables(1).Columns(1).Cells(1).Range
rngRange.MoveEnd wdCharacter, -1
ActiveDocument.Fields.Add rngRange, wdFieldDate

--
Chuck Henrich
www.ProductivityApps.com


"Peter" wrote:

> I use "ActiveDocument.Fields.Add Range:=..." all over the document and it
> works fine. When the range is myTbl.Columns(1).Cells(1).Range I get "Runtime
> error '4605' This command is not available". What am I doing wrong please?