title: CallByName syntax
body: <p>I want to process incoming mails.</p>
  
  <p>My code has a lengthy conditional statement, to determine the category to which each incoming email belongs.</p>
  
  <p>Based on the result of this conditional statement, the code is supposed to read the appropriate property of the MailItem object.</p>
  
  <p>I want to use CallByName function to achieve this.</p>
  
  <pre><code>x = CallByName(itm, PAN_Source, VbGet)
  </code></pre>
  
  <p>Where 'itm' is the MailItem Object, 'PAN_Source' variable contains the string, which refers to the specific property from 'itm'.</p>
  
  <p>For example, if an incoming mail has an attachment, then 'PAN_Source' is given the value "Attachments.Item(1).DisplayName". I want CallByName(itm, PAN_Source, VbGet) to return itm.Attachments.Item(1).DisplayName</p>
  
  <p>The code just stops execution at this stage.</p>