Solved

Print emails after they are sent

Posted on 2006-11-13
3
447 Views
Last Modified: 2008-04-03
We are running SBS 2003 with 44 users and use Outlook 2002/2003 as our email client. The partners of the firm want a pop up window after every email is sent giving the option of printing the email. I have found a VB macro that lets you print and send (in that order) but not quite what I'm after.

I have allocated 500 points to this question due to the urgent nature. As usual they want it yesterday!!!!

Has anyone any suggestions??

Thanks

Mr Tanner
0
Comment
Question by:mrtanner87
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
Comment Utility
Greetings, mrtanner87.

Native Outlook has no option for doing this.  This will require a macro like the one below.  Follow these instructions to use it.

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code and paste it into the right-hand pane of the VB Editor window
5.  Click the diskette icon on the toolbar to save the changes
6.  Close the VB Editor
7.  Click Tools->Macro->Security
8.  Set the Security Level to Medium
9.  Close Outlook
10.  Start Outlook
11.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.

This macro works by watching the Sent Items folder.  When a new item hits the folder the macro fires.  It displays a dialog-box asking if the user wants to print the message that just appeared in Sent Items.  If they select Yes, then the item is printed using the default print settings.  That is the only print option available from code.  

Dim WithEvents olkSentItems As Outlook.Items

Private Sub Application_Quit()
    Set olkSentItems = Nothing
End Sub

Private Sub Application_Startup()
    Set olkSentItems = Session.GetDefaultFolder(olFolderSentMail).Items
End Sub

Private Sub olkSentItems_ItemAdd(ByVal Item As Object)
    Dim intDays As Integer
    If Item.Class = olMail Then
        If MsgBox("Do you want to print this item?", vbYesNo + vbQuestion, "Print Sent Item") = vbYes Then
            Item.PrintOut
        End If
    End If
End Sub

Cheers!
0
 

Author Comment

by:mrtanner87
Comment Utility
Hi BlueDevilFan,

Mate, this is perfect.. Thanks very much


Mr Tanner
0
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
You're welcome.  Glad I was able to help out.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
Resolve DNS query failed errors for Exchange
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now