Print first page of a new email

Status
Not open for further replies.

Arno

New Member
Outlook version
Outlook 2007
Email Account
Exchange Server
I want to print the first page of every new email of a certain kind. I know how to make a rule to make the selection, but I'm completely blank what to put in the VBA script. Any ideas?

I got the selection working, with a rule which runs this script. But the printing part.... dunno....

Sub NewEmail(Item As MailItem)
MsgBox ("New email received: " & Item.Subject) 'just for testing.....

'but now.... print this email on the defaut printer, first page only... how?

End Sub
 

Arno

New Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Code:
Item.GetInspector.Wordeditor.Printout Range:=wdPrintFromTo, From:="1", To:="1"
Thanks Michael, but I tried it, it doesn't work.

I found this at msdn:

PrintOut
Prints the Outlook item using all default settings.The PrintOut method is the only Outlook method that can be used for printing.

So I'm afraid it's not possible to print only the first page.
 

Arno

New Member
Outlook version
Outlook 2007
Email Account
Exchange Server
PrintOut is only if you use outlook's native print command. you can call up word (since its the editor for outlook).
But... like I said, it's not working. Nothing happens (but also no error message). How can I get this working?
 

Arno

New Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Show the code, please.

Sub NewEmail(Item As MailItem)
MsgBox ("New email received: " & Item.Subject) 'just for testing.....
Item.GetInspector.Wordeditor.Printout Range:=wdPrintFromTo, From:="1", To:="1"
End Sub

Just the line I had... and the printout line. The message works (so the sub gets called when a new email arrives), but nothing is printed. Did I miss something?
 
Status
Not open for further replies.
Top