I have no idea what toggle buttons you're referring to, so I can't help you with that. Additionally, if all you're doing is inserting a table, you could use code like:
Code:
Sub InsertFooterPage()
Application.ScreenUpdating = False
Dim HdFt As HeaderFooter, Rng As Range, Tbl As Table
For Each HdFt In ActiveDocument.Sections.Last.Footers
If HdFt.Exists Then
Set Rng = ActiveDocument.Fields.Add(Range:=HdFt.Range, Type:=wdFieldEmpty, Text:="IF= ", PreserveFormatting:=False).Code
With Rng
.Collapse wdCollapseEnd
Set Tbl = .Tables.Add(.Duplicate, 1, 1)
Tbl.Cell(1, 1).Range.Text = "Hello World"
Tbl.Range.Characters.Last.Next.InsertBefore Chr(34)
Tbl.Range.Characters.First.Previous.InsertBefore Chr(34)
.End = Tbl.Range.Start - 3
.Fields.Add Range:=Rng, Type:=wdFieldNumPages, PreserveFormatting:=False
.End = .End - 2
.Fields.Add Range:=Rng, Type:=wdFieldPage, PreserveFormatting:=False
End With
End If
Next
Application.ScreenUpdating = True
End Sub
or even:
Code:
Sub InsertFooterPage()
Application.ScreenUpdating = False
Dim HdFt As HeaderFooter, Rng As Range, Tbl As Table
For Each HdFt In ActiveDocument.Sections.Last.Footers
If HdFt.Exists Then
Set Rng = ActiveDocument.Fields.Add(Range:=HdFt.Range, Type:=wdFieldEmpty, Text:="IF= """"", PreserveFormatting:=False).Code
With Rng
.Collapse wdCollapseEnd
.End = .End - 2
Set Tbl = .Tables.Add(.Duplicate, 1, 1)
Tbl.Cell(1, 1).Range.Text = "Hello World"
.End = Tbl.Range.Start - 3
.Fields.Add Range:=Rng, Type:=wdFieldNumPages, PreserveFormatting:=False
.End = .End - 2
.Fields.Add Range:=Rng, Type:=wdFieldPage, PreserveFormatting:=False
End With
End If
Next
Application.ScreenUpdating = True
End Sub