title: How do I extract a portion of a file name in VBA?
body: <p>I need to extract a portion of a file name from the filepath. 
  My macro needs to be able to handle paths/names of varying length, but the porition of the file name I want always starts at the same place; I need to extract the portion of just the filename starting 14 characters in from the beginning and ending before the file extension (excluding the "."). </p>
  
  <p>For example, I want my macro to extract the text <code>"Fixed Table"</code> from the following path name:</p>
  
  <pre><code>C:\Users\m.jones\Desktop\New folder (2)\LS4102-104-01 Fixed Table.slddrw
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I just experimented with this, and the code below seems to work. Is this a valid approach, or am I going to run in to issues?</p>
  
  <pre><code>PartNoDes = Mid(swDraw.GetPathName, InStrRev(swDraw.GetPathName, "\") + 1)
  PartNoDes = Right(PartNoDes, Len(PartNoDes) - 14)
  PartNoDes = Left(PartNoDes, Len(PartNoDes) - 7)
  </code></pre>