Consulting

Results 1 to 3 of 3

Thread: Automatically Move Emails in a Shared Folder to my Personal Inbox

  1. #1

    Automatically Move Emails in a Shared Folder to my Personal Inbox

    I have a shared inbox that I'm constantly moving emails out of and into my personal inbox. I would like to have any email that arrives in that shared folder to be automatically moved into my local/personal inbox. There doesn't appear to be any rule that will do that and I haven't been able to find any other threads that address this issue. Any help would be much appreciated. Thanks.

  2. #2
    Additional details: the emails are arriving in a Group Inbox, then those emails are sorted into different inboxes. Whenever an email is moved to a specific shared folder, I would like it to be automatically moved into my inbox.

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,391
    Location
    Just guessing here but try this

    Sub MoveEmailsFromSharedToPrivate()
        Dim objOutlook As Object
        Dim objSharedInbox As Object
        Dim objPrivateInbox As Object
        Dim objEmail As Object
        ' Create an Outlook Application object
        Set objOutlook = CreateObject("Outlook.Application")
        ' Get the shared Inbox folder
        ' Replace "Shared Inbox" with the actual name of your shared mailbox
        Set objSharedInbox = objOutlook.GetNamespace("MAPI").Folders("Shared Inbox") 
        ' Get your private Inbox folder
        Set objPrivateInbox = objOutlook.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
        ' Loop through each email in the shared Inbox
        For Each objEmail In objSharedInbox.Items
            ' Move the email to your private Inbox
            objEmail.Move objPrivateInbox
        Next objEmail
            ' Clean up
            Set objEmail = Nothing
            Set objSharedInbox = Nothing
            Set objPrivateInbox = Nothing
            Set objOutlook = Nothing
    End Sub
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

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