Consulting

Results 1 to 3 of 3

Thread: Export Outlook folders to file folders

  1. #1
    VBAX Newbie
    Joined
    Apr 2024
    Posts
    2
    Location

    Export Outlook folders to file folders

    I had some VBA that was stored in Outlook for a long time where I could click the macro to run the VBA and it would ask me which folder I wanted to backup, then I would choose. After that it would allow me to browse my file folders to select where to export the data in an Outlook Item format. It disappeared somehow.
    I thought this may have been it below, but I can't get it to work. I know enough to be dangerous but would like to have something functional again.

    I get an error when it makes it to this item, saying Sub or Function not defined. SaveItem olItem

    Sub SaveFolderMessages()
    'Graham Mayor - Last updated - 04 Nov 2017
    Dim olFolder As Folder
    Dim olItem As MailItem
    Dim iCount As Integer
        On Error GoTo NextItem
        Set olFolder = Session.PickFolder
        For iCount = 1 To olFolder.Items.Count
            Set olItem = olFolder.Items(iCount)
            If olItem.Class = OlObjectClass.olMail Then
                SaveItem olItem
            End If
    NextItem:
        Next iCount
    lbl_Exit:
        Set olItem = Nothing
        Set olFolder = Nothing
        MsgBox "Process finished"
        Exit Sub
    End Sub

  2. #2
    VBAX Mentor
    Joined
    Nov 2022
    Location
    The Great Land
    Posts
    371
    Location
    SaveItem most likely another VBA procedure which is missing.
    How to attach file: Reading and Posting Messages (vbaexpress.com), click Go Advanced below post edit window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    VBAX Newbie
    Joined
    Apr 2024
    Posts
    2
    Location
    Your right. Turns out this is not what I am looking for. This does not save folders/sub folders.

Posting Permissions

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