P
pmm
Hi - After many attempts, I have almost given up. Hoping to find help
in here.
Should have added two fields on the form "x / y" in the top cell in a
table of two rows in the footer.
The code below shows what I could find, but do not operate optimally.
Can not get the fields inserted in the upper cell, nor have the slash
between the two fields.
Sub InsertFields_FooterCell()
Dim rngCell As Range
Set rngCell =
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Tables(1).Cell(1,
1).Range
rngCell.Collapse wdCollapseEnd
Set rngCell = rngCell.Paragraphs(1).Range
With rngCell
.Collapse wdCollapseEnd
.Fields.Add Range:=rngCell, Type:=wdFieldNumPages
.Collapse wdCollapseEnd
.Text = "/"
.Collapse wdCollapseEnd
.Fields.Add Range:=rngCell, Type:=wdFieldPage
End With
Set rngCell = rngCell.Paragraphs(1).Range
rngCell.Fields.Update
End Sub
in here.
Should have added two fields on the form "x / y" in the top cell in a
table of two rows in the footer.
The code below shows what I could find, but do not operate optimally.
Can not get the fields inserted in the upper cell, nor have the slash
between the two fields.
Sub InsertFields_FooterCell()
Dim rngCell As Range
Set rngCell =
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Tables(1).Cell(1,
1).Range
rngCell.Collapse wdCollapseEnd
Set rngCell = rngCell.Paragraphs(1).Range
With rngCell
.Collapse wdCollapseEnd
.Fields.Add Range:=rngCell, Type:=wdFieldNumPages
.Collapse wdCollapseEnd
.Text = "/"
.Collapse wdCollapseEnd
.Fields.Add Range:=rngCell, Type:=wdFieldPage
End With
Set rngCell = rngCell.Paragraphs(1).Range
rngCell.Fields.Update
End Sub