Solved

Rules to send a copy of email to a file server

Posted on 2006-06-22
6
182 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
ID: 16958495
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
ID: 16958627
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
ID: 16959234
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
ID: 17065948
Hi, madpete8.

Any progress?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
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…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

809 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