<p>Someone posted a great little function here the other day that separated the full path of a file into several parts that looked like this:</p>

<pre><code>Function BreakDown(Full As String, FName As String, PName As String, Ext As String) As Integer
 If Full = "" Then
 BreakDown = False
 Exit Function
 End If
 If InStr(Full, "\") Then
 FName = Full
 PName = ""
 Sloc% = InStr(FName, "\")
 Do While Sloc% &lt;&gt; 0
   PName = PName + Left$(FName, Sloc%)
   FName = Mid$(FName, Sloc% + 1)
   Sloc% = InStr(FName, "\")
 Loop
 Else
 PName = ""
 FName = Full
 End If
Dot% = InStr(Full, ".")
If Dot% &lt;&gt; 0 Then
 Ext = Mid$(Full, Dot%)
Else
 Ext = ""
End If
BreakDown = True

End Function
</code></pre>

<p>However if the line continues past that point it counts it as part of the extension, is there anyway to make this only count to 3 characters after the last period in a string?</p>

If you just have blank characters then just add this as the first line
```
```
Full = Trim(Full)
```
```
If you have other characters then
Change:
```
```
Ext = Mid$(Full, Dot%)
```
```
to:
```
```
Ext = Mid$(Full, Dot%, 3)
```
```