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



Reply With Quote
