Print Emails Automatically

This sample prints every new email.

Last modified: 2007/03/24 | Accessed: 35.853  | #48
◀ Previous sample Next sample ▶
Reporter Reporter
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.

This sample prints every e-mail that's gets into the inbox and is unread (so it also prints unread e-mails that you move manually from any folder into the inbox).

tip  How to add macros to Outlook
Private WithEvents Items As Outlook.Items

Private Sub Application_Startup()
  Dim Ns As Outlook.NameSpace

  Set Ns = Application.GetNamespace("MAPI")
  Set Items = Ns.GetDefaultFolder(olFolderInbox).Items
End Sub

Private Sub Items_ItemAdd(ByVal Item As Object)
  If TypeOf Item Is Outlook.MailItem Then
    PrintNewItem Item
  End If
End Sub

Private Sub PrintNewItem(Mail As Outlook.MailItem)
  On Error Resume Next

  If Mail.UnRead Then
  End If
End Sub
Determine the "identity" of your emails. Set with SAM the sender, signature and folder for sent items with the help of rules.
email  Send a message