Of course, there is always more than one way to skin a cat, especially when it comes to programming. Here's what Michael Brinkley had to offer that does the same thing with a lot less work:
Function truncLine(inputString,maxlength)
If len(inputString) > maxlength Then
inputString = left(inputString,maxlength)
inputString = left(inputString,inStrRev(inputString," "))
End If
truncLine = inputString
End Function