How to access the completed flag date?

I transfer my letters by selecting "Follow up - Mark completed Option" to another folder. Now I want to write a program to verify that many emails were filled in today by comparing the completion date of the flag with today's date.

But I can not find how to access the completed flag date.

You can help.

Thanks Alok

+3
source share
2 answers

The property is Outlook.MailItem.TaskCompletedDate. Try something like:

Sub GetCompletedToday()
Dim olNameSpace As Outlook.NameSpace
Dim olFolder As Outlook.Folder
Dim olMailItem As Outlook.MailItem
Dim CompletedTodayCount As Long

Set olNameSpace = Application.GetNamespace("MAPI")
Set olFolder = olNameSpace.Folders(1).Folders("tester")

For Each olMailItem In olFolder.Items
    If olMailItem.TaskCompletedDate = Date Then
        CompletedTodayCount = CompletedTodayCount + 1
    End If
Next olMailItem
Debug.Print CompletedTodayCount
End Sub
+4
source

You can access the flags with expression.FlagStatus

See this link

Subject: FlagStatus Property

Link : http://msdn.microsoft.com/en-us/library/aa212013%28v=office.11%29.aspx

,

VBA

Option Explicit

Sub Sample()
    Dim Messages As Selection
    Dim Msg As MailItem
    Dim NamSpace As NameSpace

    Set NamSpace = Application.GetNamespace("MAPI")
    Set Messages = ActiveExplorer.Selection

    If Messages.Count = 0 Then Exit Sub

    For Each Msg In Messages
        Debug.Print Msg.FlagStatus
    Next
End Sub

() No flags 0

Mark Completed 1

Other flags 2

, If .FlagStatus .

0

All Articles