title: How to apply the action to several Outlook items selected?
body: <p>The code <a href="http://msdn.microsoft.com/en-us/library/bb176426%28v=office.12%29.aspx" rel="nofollow">here</a> works for one item only. How to modify that to run <code>DisplayItemMetadata</code> (see the code) for each item selected?</p>
  
  <p>Upd. tried to do the following:</p>
  
  <pre><code>For Each individualItem In Application.ActiveExplorer.Selection
      With objButton
          .BeginGroup = True
          .Caption = "My &amp;item"
          .FaceId = 1000
          .Tag = "DisplayItemMetadata"
          If Not IsNull(Selection.Item(1)) Then
              On Error GoTo 0
              ' Just in case the item selected
              ' doesn't have a valid EntryID.
              ' .Parameter = Selection.Item(1).EntryID
              .Parameter = individualItem.EntryID
              On Error GoTo ErrRoutine
          End If
          .OnAction = _
              "Project1.ThisOutlookSession.DisplayItemMetadata"
      End With
  
  Next individualItem
  </code></pre>