Ö
Örjan Skoglösa
Hi,
I have a document with a lot of sections and different footers.
In every footer is a table.
I want to insert a pagenumber field in a certain cell of the table.
When I run my code I get the error message that the object does not
support this method.
TIA
Örjan
----------
Sub test()
Dim mySec, myFooter, myField
For Each mySec In ActiveDocument.Sections
For Each myFooter In mySec.Footers
Set myField =
myFooter.Fields.Add(Range:=myFooter.Range.Tables(1).Cell(Row:=1,
Column:=1).Range, _
Type:=wdFieldPage)
Next
Next
End Sub
I have a document with a lot of sections and different footers.
In every footer is a table.
I want to insert a pagenumber field in a certain cell of the table.
When I run my code I get the error message that the object does not
support this method.
TIA
Örjan
----------
Sub test()
Dim mySec, myFooter, myField
For Each mySec In ActiveDocument.Sections
For Each myFooter In mySec.Footers
Set myField =
myFooter.Fields.Add(Range:=myFooter.Range.Tables(1).Cell(Row:=1,
Column:=1).Range, _
Type:=wdFieldPage)
Next
Next
End Sub