0

私は通常、メールを確認し、フォローアップのために何かにフラグを付けて、次のように分類します。

  1. 電話
  2. Eメール
  3. に話す
  4. 会議の設定

Outlook VBA マクロで (1 つのマクロで) フォローするアイテムにフラグを立て、上記のカテゴリのいずれかを設定する方法はありますか?

4

1 に答える 1

1

私は答えを見つけました。。以下に記載されています 。. .

Private Sub TagArchived1(category As String)

    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 = category
            m.FlagStatus = olFlagMarked
            m.FlagIcon = 6
            m.Save
        Next x

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

    ' Set all objects equal to Nothing to destroy them and
    ' release the memory and resources they take.
    Set objOutlook = Nothing
    Set objExplorer = Nothing
End Sub
于 2009-11-14T21:17:51.517 に答える