2

電子メールにフラグを追加するコードがいくつかありますが、以下のコードを削除しようとすると、Outlook2007では効果がないようです。

    Public Sub Clear()
        Dim objOutlook As Outlook.Application
        Dim objInspector As Outlook.Inspector

        Dim strDateTime As String

        ' Instantiate an Outlook Application object.
        Set objOutlook = CreateObject("Outlook.Application")

        ' The ActiveInspector is the currently open item.
        Set objExplorer = objOutlook.ActiveExplorer

        ' Check and see if anything is open.
        If Not objExplorer Is Nothing Then
            ' Get the current item.
            Dim arySelection As Object
            Set arySelection = objExplorer.Selection

            For x = 1 To arySelection.Count
                Dim m As MailItem
                Set m = arySelection.Item(x)
                m.Categories = ""
                m.FlagStatus = olNoFlag
                m.FlagIcon = 0
                m.Save
            Next x

        Else
            ' Show error message with only the OK button.
            MsgBox "No explorer is open", vbOKOnly
        End If

    End Sub
4

1 に答える 1

3

Outlook 2007は2003をサポートしていません-スタイルフラグ(タスクフラグと最も適切なカテゴリの色にマップします)。

クリアしようとしているフラグは、おそらくタスクフラグです。その場合、

m.ClearTaskFlag
m.Save

仕事をします。

于 2009-11-14T15:58:00.553 に答える