title: Create an `Items` collection containing references to already existing `Item`s
body: <p>I mean to create an <code>Items</code> collection, and add to it several already existing <code>Item</code>s.
  For instance, if I have two references to <code>MailItem</code>s, I want to set an <code>Items</code> collection containing those two <code>Item</code>s.</p>
  
  <p>It would be something like</p>
  
  <pre><code>' ...
  ' Code that assigns references to olMail1 and olMail2, of type Outlook.MailItem
  ' ...
  Dim MyItems As Outlook.Items
  ' Assign with Set / create the object
  MyItems.Add olMail1
  MyItems.Add olMail2
  
  ' Code that can use MyItems(1) to get a reference to olMail1
  </code></pre>
  
  <p>How can that be done?</p>
  
  <p>Things to clarify are:</p>
  
  <ol>
  <li>How to setup the new collection.</li>
  <li>How to add items.
  <a href="https://msdn.microsoft.com/en-us/library/office/ff861028%28v=office.14%29.aspx" rel="nofollow noreferrer">Documentation on Items.Add</a> seems to indicate that it is used for adding newly created objects, not references to existing Items.</li>
  </ol>
  
  <p>I would later iterate through that collection, for instance. I would also apply <code>Find</code> or <code>Restrict</code>; this allows for applying the methods on a much smaller collection than a whole <code>Folder</code>.</p>
  
  <p>PS: I cannot get an <code>Items</code> collection even from 
  <code>Application.ActiveExplorer.Selection</code> (i.e., without need for creating the collection and add <code>Item</code>s one by one). This would be good for a starter.</p>
  
  <hr>
  
  <p><strong>Background</strong></p>
  
  <p>I mean to find what <code>Item</code>s have a sender matching a given string. The <em>aspects</em> that perhaps make my case somewhat more complex than a "base case" are:</p>
  
  <ol>
  <li>I mean to apply the filter only on a selected group of items. E.g., only on the <code>Item</code>s that are selected in the Inbox index.</li>
  <li>I want to do partial matching. At this point I do not need regular expressions, or even full use of wildcards *?. But at least partial matching as in <code>InStr</code>.</li>
  <li>I mean to have a specific <code>Function</code> for the minimal unit: testing one <code>Item</code>, for a single condition. Then loop through all target <code>Item</code>s, and all conditions.</li>
  </ol>
  
  <p>I conceived 3 <em>approaches</em>:</p>
  
  <ol>
  <li>Use <code>Rules</code>.</li>
  <li>Use <code>Filter</code> or <code>Restrict</code>. These do not accept wildcards (in principle?).</li>
  <li>"Manually" check conditions, with <code>InStr</code>, e.g.</li>
  </ol>
  
  <p>Each of the <em>aspects</em> above may bear some complexity for one or more of the <em>approaches</em>.</p>
  
  <p>At this point, I was exploring approach 2. I have a reference to a single <code>Item</code>, and I found how to apply a <code>Filter</code> with a matching condition (see
  <a href="http://www.outlookcode.com/news.aspx?id=30" rel="nofollow noreferrer">http://www.outlookcode.com/news.aspx?id=30</a> , 
  <a href="http://blogs.msdn.com/b/andrewdelin/archive/2005/05/11/416312.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/b/andrewdelin/archive/2005/05/11/416312.aspx</a> , and the non-accepted answer of <a href="https://stackoverflow.com/questions/21549938/vba-search-in-outlook">VBA Search in Outlook</a>). But to apply the <code>Filter</code>, I need an <code>Items</code> collection, containing my single item.</p>
  
  <p>I have something working with approach 3 (as suggested in the accepted answer of <a href="https://stackoverflow.com/questions/21549938/vba-search-in-outlook">VBA Search in Outlook</a>).</p>
  
  <p>Related links</p>
  
  <p><a href="https://stackoverflow.com/questions/29019284/identify-mailitems-satisfying-a-rule">Identify MailItems satisfying a Rule</a></p>