Check Out Our Shop
Results 1 to 7 of 7

Thread: Computer Nerds: Outlook Message Saving Q

  1. #1
    Join Date
    Sep 2001
    Location
    Alco-Hall of Fame
    Posts
    2,997

    Computer Nerds: Outlook Message Saving Q

    anybody know how to batch save outlook emails in a format that preserves any attachments? (msg or outlook)

    I can do it one at a time but it doesn't want to let me do them in bulk. (outside the normal archiving/.pst methods obviously). This is for long term storage with open access to those who can get to the destination folder.
    "It is not the result that counts! It is not the result but the spirit! Not what - but how. Not what has been attained - but at what price.
    - A. Solzhenitsyn

  2. #2
    Join Date
    Oct 2005
    Location
    Sandy
    Posts
    5,374
    This might be one path:

    This feature requires you to be using a Microsoft Exchange Server e-mail account.

    An Offline Folder file (.ost) (Offline Folder file: The file on your hard disk that contains offline folders. The offline folder file has an .ost extension. You can create it automatically when you set up Outlook or when you first make a folder available offline.) is used to keep a local copy of your Exchange Server mailbox on your computer. The items in your .ost file are synchronized with the server when a connection is available.

    On the File menu, click Work Offline.
    Select or clear the Prompt me at startup so I may choose to work offline or online check box, and then click OK.
    If you clear the check box, Outlook will automatically start offline if a connection to the server is not available.

    Click Yes to copy the data from the server to your new Offline Folder file (.ost).
    Note In Microsoft Office Outlook 2003, a new offline folder file format is introduced that offers greater storage capacity for items and folders and supports multilingual Unicode (Unicode: A character encoding standard developed by the Unicode Consortium. By using more than one byte to represent each character, Unicode enables almost all of the written languages in the world to be represented by using a single character set.) data. A file created in this format is not compatible with previous versions of Outlook and cannot be opened in a previous version of Outlook. Outlook automatically determines the format in which the offline folder file is created based on the version of the Microsoft Exchange Server, administrator settings, and formats of the data files that are configured for the profile. If the settings do not allow the file to be created in the new format, Outlook creates the file in the format that is compatible with previous versions of Outlook that does not support Unicode and offers the same storage capacity that was available in previous versions of Outlook.
    When life gives you haters, make haterade.

  3. #3
    Join Date
    Feb 2005
    Posts
    19,787
    Try making a copy of your outlook.pst file.
    Is it radix panax notoginseng? - splat
    This is like hanging yourself but the rope breaks. - DTM
    Dude Listen to mtm. He's a marriage counselor at burning man. - subtle plague

  4. #4
    Join Date
    Jul 2002
    Location
    Suckramento
    Posts
    21,975
    Instead of copying them, can you move them in bulk to a seperate folder?
    Quando paramucho mi amore de felice carathon.
    Mundo paparazzi mi amore cicce verdi parasol.
    Questo abrigado tantamucho que canite carousel.


  5. #5
    Join Date
    Nov 2002
    Location
    Powpow New Guinea
    Posts
    2,981
    Create "Personal Folders" on your harddrive in

    C:\Documents and Settings\YOUR INFO HERE\Local Settings\Application Data\Microsoft\Outlook\Personal Folders.pst

  6. #6
    Join Date
    Sep 2001
    Location
    Alco-Hall of Fame
    Posts
    2,997
    sfotex- this needs to be outside the email server/client and accessible to third parties so I don't think that will work but thanks for trying.

    makers/homer- they periodically strip .pst files out of the shared servers I already have a personal archive but need a shared one for group info.

    irul- Moving them works fine except that it strips out the attachments, which I need
    "It is not the result that counts! It is not the result but the spirit! Not what - but how. Not what has been attained - but at what price.
    - A. Solzhenitsyn

  7. #7
    Join Date
    Jan 2005
    Location
    North Sierra, West slope
    Posts
    406
    If a .msg file is ok for your purposes, you should use it as it saves the attachments as part of the file. You can save the messages as other filetypes (txt, doc, rtf, html, etc), but then you have to handle the attachments seperatly.

    You can use the following code to export all messages from a folder that you choose. You will need to copy this into the Outlook VBA editor. Have your outlook activated and press Alt-F11 to bring up the VBA window. Paste the code in there. Change the 'strFilePath = "C:\Data\Email\"' to the folder you want to export to. This can be a network drive as well (strFilePath = "\\Sample\Network\Drive\). Make sure that the folder exists already and that you put the final backslash '\' at the end of the string.

    Once this is done you can run the code by choosing the Tools\Macro\Macros... option from the outlook application and selecting the ExportMail macro. This will pop up a window where you can select the mailbox to export.

    Code:
    Public Sub ExportMail()
    On Error Resume Next
    Dim otlNameSpace As Outlook.NameSpace
    Dim otlFolder As Outlook.MAPIFolder
    Dim oltAttachment As Outlook.Attachment
    Dim intMessageNumber As Integer
    Dim otlMailItem As Outlook.MailItem
    Dim strFilePath As String
    Dim strSubject As String
    strFilePath = "C:\Data\Email\"
    'get reference to inbox
    Set otlNameSpace = Outlook.GetNamespace("MAPI")
    Set otlFolder = otlNameSpace.PickFolder
    For Each otlMailItem In otlFolder.Items
        'change illegal file characters to underscore
        strSubject = Replace(otlMailItem.Subject, "/", "_", 1)
        strSubject = Replace(strSubject, "\", "_", 1)
        strSubject = Replace(strSubject, ":", "_", 1)
        strSubject = Replace(strSubject, "*", "_", 1)
        strSubject = Replace(strSubject, "?", "_", 1)
        strSubject = Replace(strSubject, "chr(34)", "_", 1)
        strSubject = Replace(strSubject, "<", "_", 1)
        strSubject = Replace(strSubject, ">", "_", 1)
        strSubject = Replace(strSubject, "|", "_", 1)
     
        intMessageNumber = intMessageNumber + 1
        Debug.Print strFilePath & strSubject & "_" & intMessageNumber & ".msg"
        otlMailItem.SaveAs strFilePath & strSubject & "_" & intMessageNumber & ".msg", olMSG
     
    Next otlMailItem
     
    Set oltAttachment = Nothing
    Set otlMailItem = Nothing
    Set otlFolder = Nothing
    Set otlNameSpace = Nothing
     
    MsgBox "Exported " & intMessageNumber & " files."
     
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •