Change Flagstatus on moving to Shared Mailbox

Is it possible to change the Flagstatus of emails moved to a folder in a shared mailbox?

Example: I receive a new mail and mark it with a red flag. Then, when the job is completed, I move the mail to the folder "Completed".

After moving the mail to this folder, I want the Flagstatus to be "olFlagComplete" (Green Flag) and every time I open Outlook, the code should check the folder for mails with red flag (e.g. Mails moved from mobile phone) and set it to green flag.

I tried the following, but nothing happened.

Private WithEvents Items As Outlook.Items

Private Sub Application_Startup()
    Dim olNameSpace As Outlook.NameSpace
    Dim olFolder As Outlook.MAPIFolder

    Set olNameSpace = Application.GetNamespace("MAPI")
    Set olFolder = olNameSpace.Folders("name@company.com")
    Set olFolder = olFolder.Folders("Completed")
    Set Items = olFolder.Items
End Sub

Private Sub Items_ItemChange(ByVal Item As Object)
    Dim olNameSpace As Outlook.NameSpace
    Dim olFolder As Outlook.MAPIFolder
    Dim Mail As MailItem

    Set olNameSpace = Application.GetNamespace("MAPI")
    Set olFolder = olNameSpace.Folders("name@company.com")
    Set olFolder = olFolder.Folders("Completed")

    If TypeOf Item Is Outlook.MailItem Then
        Set Mail = Item

        If Mail.FlagStatus = olFlagMarked Then
            'Set ItemCopy = Item.Copy ' Copy Flagged item
            'ItemCopy.Move olFolder ' Move Copied item
            Set Mail.FlagStatus = olFlagComplete
        End If

        Set Item = Nothing
        'Set ItemCopy = Nothing
    End If
End Sub

Is this what you are trying to do?

Option Explicit
Private Sub Application_Startup()
    Dim Item As Object
    Mark_Items Item
End Sub

Private Function Mark_Items(ByVal Item As Object)
    Dim olNs As Outlook.NameSpace
    Set olNs = Application.GetNamespace("MAPI")

    Dim olShareName As Outlook.Recipient
    Set olShareName = olNs.CreateRecipient("0m3r@email.com")

    Dim olShareInbox As Outlook.folder
    Set olShareInbox = olNs.GetSharedDefaultFolder(olShareName, olFolderInbox)

    Dim Completed_Fldrs As Outlook.MAPIFolder
    Set Completed_Fldrs = olShareInbox.Folders("Completed")

    Dim Filter As String
        Filter = "@SQL=" & Chr(34) & _
                 "http://schemas.microsoft.com/mapi/proptag/0x10900003" & _
                           Chr(34) & ">1"

    Dim Items As Outlook.Items
    Set Items = Completed_Fldrs.Items.Restrict(Filter)

    Dim Mail As MailItem

    Dim i As Long
    For i = Items.Count To 1 Step -1
        DoEvents
        If TypeOf Items(i) Is Outlook.MailItem Then
            Set Mail = Items(i)
            Debug.Print Mail.Subject
            Mail.FlagStatus = olFlagComplete
            Mail.Save
        End If
    Next

End Function

Shared Mailbox Move Issue / Category Issue / Refresh Issue, all able to set their default quick click, and it doesn't change the others. This is NOT how shared folders act. infact I cannot reproduce this on ANY This error prompts when they move the message from the PS inbox, to the PS inbox subfolder. when done they will mark it completed with the flag status. 2. Consider weather exposure when moving your house mailbox. If you plan to move your house mailbox, consider how the location is affected by weather during different seasons. While relocating a residential mailbox to the front of your driveway or moving your mailbox to other side of road may seem convenient, that same location could possibly

  1. The first task is to mark all completed items with a green flag at startup:
Private WithEvents Items As Outlook.Items

Private Sub Application_Startup()
    Dim olNameSpace As Outlook.NameSpace
    Dim olFolder As Outlook.MAPIFolder

    Set olNameSpace = Application.GetNamespace("MAPI")
    Set olFolder = olNameSpace.Folders("name@company.com")
    Set olFolder = olFolder.Folders("Completed")
    Set Items = olFolder.Items
    For Each Item In Items
      If TypeOf Item Is Outlook.MailItem Then
        Set Mail = Item

        If Mail.FlagStatus = olFlagMarked Then
            Set Mail.FlagStatus = olFlagComplete
        End If
      End If
     Next 

End Sub

  1. The second part is to handle newly added items to the Completed folder:
Private Sub Items_ItemAdd(ByVal Item As Object)  
    If TypeOf Item Is Outlook.MailItem Then
        Set Mail = Item

        If Mail.FlagStatus = olFlagMarked Then            
            Set Mail.FlagStatus = olFlagComplete
        End If        
    End If
End Sub

Convert a user mailbox to a shared mailbox, In the admin center, go to the Users > Active users page. Select the user whose mailbox you want to convert. In the right pane, expand Mail Settings. Next to More settings, select Convert to shared mailbox. Convert a user mailbox to a shared mailbox. 5/27/2020; 5 minutes to read; In this article. When you convert a user's mailbox to a shared mailbox, all of the existing email and calendar is retained. Only now it's in a shared mailbox where several people will be able to access it instead of one person.

You need to save the message afterwards - call Mail.Save after setting the FlagStatus property.

Positioning the flag column to the left, To be able to move the flag status column, click on the 'View' menu > 'Arrange By' then select 'Custom'. From the Customize View: Messages window, click on� A shared mailbox in Office 365, in its default state, does not consume a license and does not incur a cost. However, if certain other features are desired or required, those features may require the shared mailbox to also have a license. Some common features that require a shared mailbox to have a license are: Unlimited Archive; eDiscover features

Process items in a shared mailbox, You can't run rules on a shared mailbox and client-side rules in a mailbox Trust Center and open Trust Center Settings, and change the Macro Settings. Hi , I need to build a macro to track the mails moved from one mail box to other in a shared mail box in excel ,Can FlagStatus = olFlagComplete hi marc, it’s not feasible to transfer the legacyexchangedn from a distribution group to a shared mailbox. if you need the shared mailbox shared.support@ to receive the email which is sent to support@, you can delete the distribution group and then add the email address support@ to the shared mailbox shared.support@. also, you can make the email address support@ as the primary/reply address

Outlook Categories, Flags, and IMAP Accounts, While you can't change how flags work (except by moving the mail to a local pst), Category Manager allows sharing of color categories; it adds a sidebar to the� Configuring Region and Timezone Settings for Shared Mailboxes in Office 365 using OWA. To manually configure region and timezone settings for a shared mailbox via OWA, simply log into OWA as yourself, click your avatar and select Open another mailbox. Enter the shared mailbox name and click Open.

How to add or remove flag status column in Outlook?, In this article, I will introduce ways to remove the flag status column from Mail please click the View Settings button in the Current View group on the View tab. view to other mail folders with clicking the Change View > Apply Current View to Thanks a lot for the info, in my case the whole INBOX folder was marked with a� If your organization uses a hybrid Exchange environment, you need to manage your mailboxes by using the on-premises Exchange management tools. To convert a mailbox in a hybrid environment, you might need to move the mailbox back to on-premises Exchange, convert the mailbox type, and then move it back to Microsoft 365 or Office 365.

Comments
  • Shows an error on starting Outlook. Can't find the "Completed" Folder. By Debugging it Shows "Nothing" for the "Completed_Fldrs"
  • Not really, but I can usually customize the code to my needs. Now the code works. As I can see from forums, the problem was the access to subfolders of a shared mailbox. I have solved it with this line: "Set Completed_Fldrs = olNs.GetFolderFromID("xxx")". Can you explain me how the filter works, so what exactly is filtered?
  • @IrinaG. see links on the answers stackoverflow.com/a/43268976/4539709
  • Thank you very much. Your help here is valuable :)
  • Thank you for the answer. When i put the Code to "ThisOutlookSession", then Close and open Outlook, nothing is happen.