Below is the function that is used to accomplish this task:
' Copyrights (c) 2000, Martin Jansen
' This function chops the last word of a given string.
Function ChopLastWord( Line, Length )
Dim S1, S2, I
ChopLastWord = ""
S1 = Left( Line, Length )
S2 = Left( Line, Length )
For I = Len(S1) to 1 step -1
if Mid(S1,I,1) = " " then
S2 = Left(S1,I)
I = 0
ChopLastWord = S2
This function is used just like Left(), taking an input string and a length. The length is the maximum length that the result can be, but typically the result will be LESS than this length because it will chop off entire words until the full string is less than the provided length.