Solved

Move email to folder, need to display more than subject as filename

Posted on 2004-10-14
8
302 Views
Last Modified: 2011-10-03
OK, here is what im doin...  need to move emails from my inbox to a folder on my hard drive.   When I just click and drag the emails it works fine, but it changes the file name to the subject.  I would need to display at least sender and subject as filename.

Any ideas?

I can not find any settings to change this, but I'm sure I'm just looking in the wrong place.

Thanks!
0
Comment
Question by:skwash
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 15

Accepted Solution

by:
will_scarlet7 earned 125 total points
ID: 12317721
I think you will need to have a MACRO to save the items via code. The following MACRO will save all the mail items in a selected folder to C:\temp, with the file name formated as "From - (SenderName) - (Subject).msg

Sub SaveAsOlMSG()
   
    'Declare Objects & Variables
    Dim oOutlook As Outlook.Application
    Dim oNs As Outlook.NameSpace
    Dim oFldr As Outlook.MAPIFolder
    Dim oMessage As Object
    Dim oSfMsg As Redemption.SafeMailItem
    Dim oMBox As String
    Dim oSubject As String
    Dim oSbjAlpha As String
    Dim ctr As Integer
   
    'Setup the object variables
    Set oOutlook = New Outlook.Application
    Set oNs = oOutlook.GetNamespace("MAPI")
    oMBox = MsgBox("Select the folder containg the message items you wish to save:", vbOKOnly)
    Set oFldr = oNs.PickFolder
    Set oSfMsg = CreateObject("Redemption.SafeMailItem")

oSfMsg.AuthKey = "str8isTheg8"

    For Each oMessage In oFldr.Items
            oSfMsg.Item = oMessage
            ctr = 1
            oSbjAlpha = ""
            While ctr < (Len(oSfMsg.Subject) + 1)
                If Mid(oSfMsg.Subject, ctr, 1) Like "[A-Za-z( )]" Then
                    oSbjAlpha = oSbjAlpha & Mid(oSfMsg.Subject, ctr, 1)
                ElseIf Val(Mid(oSfMsg.Subject, ctr, 1)) > 0 Then
                    oSbjAlpha = oSbjAlpha & Mid(oSfMsg.Subject, ctr, 1)
                ElseIf Mid(oSfMsg.Subject, ctr, 1) = "0" Then
                    oSbjAlpha = oSbjAlpha & Mid(oSfMsg.Subject, ctr, 1)
                ElseIf Mid(oSfMsg.Subject, ctr, 1) = "." Then
                    oSbjAlpha = oSbjAlpha & Mid(oSfMsg.Subject, ctr, 1)
                Else
                    oSbjAlpha = oSbjAlpha & " "
                End If
                ctr = ctr + 1
            Wend
            oSfMsg.SaveAs "C:\Temp\From - " & oSfMsg.SenderName & " - " & oSbjAlpha & ".msg", olMSG
            'oMessage.Move oToFldr
    Next oMessage
   
    Set oOutlook = Nothing
    Set oNs = Nothing
    Set oFldr = Nothing
    Set oSfMsg = Nothing
   

End Sub
0
 

Author Comment

by:skwash
ID: 12321426
I think you are probably right but  I am getting an error saying "compile error: user defined type not defined"  

This happens at:

    Dim oSfMsg As Redemption.SafeMailItem

I'm running Outlook 2003 if that makes a difference.  I have never created macro's in outlook so mabey I'm doing something wrong
0
 
LVL 15

Expert Comment

by:will_scarlet7
ID: 12321491
Sorry about that... I forgot to mention that in order to avoid the security warnings that outlook will throw when you save an email to disk via code I used the Outlook Redemption library. You can download Outlook Redemption from here:
http://www.dimastr.com/redemption/

If you install that (And set a reference to "SafeOutlook Library") it should run without the error. You will also need to delete the line that says:

    oSfMsg.AuthKey = "str8isTheg8"

That line is custom specific to my setup but not required on a clean setup of Outlook Redemption.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:skwash
ID: 12321711
Awesome...  looks like it will work...  I'm gonna have to make some tweaks to the code to meet our needs but this looks great!

thanks for the help!
0
 

Author Comment

by:skwash
ID: 12321850
how would I delete the mail after it has been moved to the folder?

thx
0
 

Author Comment

by:skwash
ID: 12322564
nevermind, just added oMessage.delete :P
0
 
LVL 4

Expert Comment

by:Gal_atea
ID: 12323972
Glad I could help Skwash!
God bless!

Sam
0
 
LVL 15

Expert Comment

by:will_scarlet7
ID: 12323984
Oops... Sorry... I was using my Girlfriend's computer.

ThanX!

Sam
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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 …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

710 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