Solved

Rules to send a copy of email to a file server

Posted on 2006-06-22
6
179 Views
Last Modified: 2011-09-20
I have users asking if its possible to have a rule or macro created that, when applied, is able to send a copy of a received or sent message to a file on a file server and pigeon hole according to what the subjuect line is or who its from. I am happy that several rules could be applied i just need to know how to get a copy of the email message on to a file server as an outlook item.

The users are on outlook 2003 Exchange 2003 and using XP pro sp1 with Novell Client for Windows 4.91 SP2

cheers

Pete
0
Comment
Question by:madpete8
  • 3
6 Comments
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
Greetings, madpete8.

It's definitely possible with a macro.  Saving the entire item to a file is going to trigger Outlook's built-in security which will generate a pop-up dialog-box warning that a program is accessing your mailbox and asking you for permission to continue.  If that's not a problem, then this is easy.  However, if you want this to be completely automatic, then that is a problem.  There are three workarounds for this.  One, sign the code with a digital certificate.  Two, write the code as an Outlook add-in.  They have different security rules, but are more complicated to create.  Three, use a third-party tool to circumvent Outlook security.  The two that come to mind are Click-Yes, an application that sits in your system tray and clicks "Yes" on the security dialog when it appears, and Outlook Redemption, a component object (DLL) that avoids the issue altogether.  The former is free, the latter is not.

Cheers!
0
 

Author Comment

by:madpete8
Comment Utility
Not fussed about the automation. so long as the files can be saved outside of outlook. How easy is it?

Pete
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
Comment Utility
madpete8,

It's very easy.  Something like this:

Private WithEvents olkInboxItems As Items

Private Sub Application_Startup()
    Set olkInboxItems = Session.GetDefaultFolder(olFolderInbox).Items
End Sub

Private Sub Application_Quit()
    Set olkInboxItems = Nothing
End Sub

Private Sub olkInboxItems_ItemAdd(ByVal Item As Object)
    Dim olkItems As Items, _
        olkItem As Object, _
        olkMailItem As MailItem

    Set olkItems = olkInboxItems.Restrict("[Unread] = True")
    For Each olkItem In olkItems
        If olkItem.Class = olMail Then
            Set olkMailItem = olkItem

            'Change the sender name and subject as needed
            If (olkMailItem.SenderName) = "John Doe" And (olkMailItem.Subject = "Subject A") Then
                'Change the path, filename, and save as type
                'For type you can choose between olHTML, olMSG, olRTF and olTXT
                olkMailItem.SaveAs "\\Server\Share\Some Folder\Filename", olHTML
            End If

            'Change the sender name and subject as needed
            If (olkMailItem.SenderName) = "Joe Blow" And (olkMailItem.Subject = "Subject X") Then
                'Change the path, filename, and save as type
                'For type you can choose between olHTML, olMSG, olRTF and olTXT
                olkMailItem.SaveAs "\\Server\Share\Some Folder\Filename", olHTML
            End If

            'Change the sender name and subject as needed
            If (olkMailItem.SenderName) = "Jane Smith" And (olkMailItem.Subject = "Project 27") Then
                'Change the path, filename, and save as type
                'For type you can choose between olHTML, olMSG, olRTF and olTXT
                olkMailItem.SaveAs "\\Server\Share\Some Folder\Filename", olHTML
            End If
        End If
    Next
End Sub
0
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
Hi, madpete8.

Any progress?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Create high volume marketing opportunities using email signatures with these top 10 DOs and DON'Ts of email signature marketing.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
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 Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

762 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

12 Experts available now in Live!

Get 1:1 Help Now