Hey guys... I've got some code that I'm upgrading but it doesn't like my word object reference at the bottom.
For Each Doc In Documents
Doc.Footers(wdHeaderFooterPrimary).Range.Text = Application.UserName & Date & jobnumber
Doc.PrintOut
Doc.Footers(wdHeaderFooterPrimary).Range.Text = ""
Next Doc
Doc.PrintOut works fine.
here's my whole code:
Sub PrintAllDocuments()
Dim copies As Variant
Dim jobnumber As String
sPrompt = "How many copies?"
sTitle = "Awesome Print All Macro"
sDefault = 1
copies = InputBox(sPrompt, sTitle, sDefault)
If copies = Empty Then
Exit Sub
Else
For i = 1 To copies
jPrompt = "Job Number:"
jTitle = "Awesome Print All Macro"
jDefault = ""
jobnumber = InputBox(jPrompt, jTitle, jDefault)
' Step through the open document windows
For Each Doc In Documents
Doc.Footers(wdHeaderFooterPrimary).Range.Text = Application.UserName & Date & jobnumber
Doc.PrintOut
Doc.Footers(wdHeaderFooterPrimary).Range.Text = ""
Next Doc
Next i
End If
End Sub
All I need is for these objects to print out on my document
Application.UserName & Date & jobnumber
If anyone knows a more efficient way to do this besides editing the footer, that would be a welcome option as well.
Bookmarks