title: Outlook VBA -- Trimming non-printable characters
body: <p>I am having a real struggle trying to get a string tied down to just what I need in Outlook VBA.  I have tried 100 different things from all over the internet, including here.</p>
  
  <p>I use the following:</p>
  
  <pre><code>CString = LTrim$(RTrim$(Mid(itm.Body, InStr(1, itm.Body, CCMark) + Len(CCMark), _
              InStr(InStr(1, itm.Body, CCMark) + Len(CCMark), itm.Body, CCMark) - (InStr(1, itm.Body, CCMark) + Len(CCMark)))))
  </code></pre>
  
  <p>CCMark = "C/"</p>
  
  <p>But since the body of the email contains: C/      test     C/, the variable (CString) goes to "      test    ".</p>
  
  <p>I have tried using a second variable with Trim, RTrim, LTrim, Trim$, LTrim$, and RTrim$.  Additionally, I've tried REPLACE with double space and single space.  I have tried the TrimAll function that is popular on the internet that tries to find the different Chr() values as well as vbTab, etc.  None of those seem to replace anything.</p>
  
  <p>String stays the same.</p>
  
  <p>Is this a fixed-length vs. variable-length ("sizable") string issue?  I have not found a way to convert from fixed-length to variable.  Passing through a function has not worked.</p>
  
  <p>Any advice as to how I can come out with "test" as the result?</p>
  
  <p>Thank you very much for your help.</p>