• Move Read Mail (2003)

    Author
    Topic
    #430076

    i would like to have my emails moved to a personal folder created by me – when the status changes ie is read the emails are moved to this folder. How do i do this? Thankyou!

    Viewing 0 reply threads
    Author
    Replies
    • #1004329

      Welcome to the Lounge.

      Interesting question, and it’s more interesting that MS doesn’t provide a Rule method (at least as far as I can figure out) that users can set to do this. If you are interested in a VBA solution, the following untested code should work. The code needs to entered into the “ThisOutlookSession” Module in the Visual Basic Explorer (from the Outlook Window, press Alt-F11). It assumes that you will always read messages in the default Inbox, and the code will only operate on that Inbox.

      Option Explicit

      Public WithEvents itmsInboxMessages As Outlook.Items

      Private Sub Application_Startup()
      Set itmsInboxMessages = Outlook.Session.GetDefaultFolder(olFolderInbox).Items
      End Sub

      Private Sub itmsInboxMessages_ItemChange(ByVal Item As Object)
      Dim fldrTarg As MAPIFolder
      Set fldrTarg = “HDicksonReadMessages”
      If Item.Class olMail Then Exit Sub
      If Item.UnRead = False Then Item.Move fldrTarg
      Set fldrTarg = Nothing
      End Sub

      Private Sub Application_Quit()
      Set itmsInboxMessages = Nothing
      End Sub

      The line containing

      “HDicksonReadMessages”

      will need to be edited to the name of your target folder (you can get it by selecting the folder and entering

      ?ActiveExplorer.CurrentFolder.FolderPath

      in the Immediates Window of the Visual Basic Explorer and pressing Enter.)

      Outlook must be closed and re-opened for the code to operate when it is first entered. Also, be thoughtful about interactions with Rules – this code should only run when you change any item in the inbox, so Rules on incoming messages will operate before the code does.

      • #1004733

        Hi John – thank you so much!!!!! Really appreciate it – I’ll test it tonight!
        Thanks again

      • #1023879

        Awesome, exactly what I’ve been looking for!

    Viewing 0 reply threads
    Reply To: Move Read Mail (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: