Thread: [Solved] 3 Column x of y Footer
View Single Post
 
Old 01-10-2017, 12:11 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by jmltinc View Post
The report must be created by VBA (no Macro) and insert a Footer on each page.
Macros and VBA are the same thing...

Try:
Code:
Sub Demo()
Dim Tbl As Table
With ActiveDocument
  Set Tbl = .Tables.Add(Range:=.Sections(1).Footers(wdHeaderFooterPrimary).Range, NumRows:=1, NumColumns:=3)
  With Tbl
    .Cell(1, 1).Range.Text = "QMF 24 Rev D"
    With .Cell(1, 2).Range
      .Text = "Page   of  "
      .Fields.Add .Characters(6), wdFieldPage
      .Fields.Add .Characters.Last.Previous, wdFieldNumPages
    End With
    .Cell(1, 3).Range.Text = "PRM 05/Section 4.6"
  End With
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote