Hi,
Found the code below in the internet works fine the only problem is that doesn't include the header, can it modify that include the headers as well like the attached picture, when print missing that.
here is the code:
thank you,
Found the code below in the internet works fine the only problem is that doesn't include the header, can it modify that include the headers as well like the attached picture, when print missing that.
here is the code:
VBA Code:
Public Sub PrintFirstPage(Mail As Outlook.MailItem)
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim olDoc As Word.Document
Set wdApp = CreateObject("Word.Application")
Set wdDoc = wdApp.Documents.Add(Visible:=True)
Set olDoc = Mail.GetInspector.WordEditor
olDoc.Range.Copy
wdDoc.Range.Paste
wdDoc.PrintOut Range:=wdPrintFromTo, From:="1", To:="1"
DoEvents
wdDoc.Close False
wdApp.Quit
End Sub
thank you,