N
NFL
Below is a code where I allow 31 character max to get the full name of a
person. My question is this, how do I remove the extra spaces at the end
before the text is placed in MS Word?
Thank you for your help!
' ********Code Begins ****************
Dim FullName as String
Dim CASELEN as Long
Dim Testname as string
Dim Q as Integer
FullName = CurrentScreenObject.getstring(3, 33, 31)
CASELEN = Len(FullName)
For Q = 1 To CASELEN
Testname = Mid(FullName, Q, 1)
If Testname = " " Then
FullName = Left(FullName, Q - 1)
Exit For
End If
Next Q
If FullName <> "" Then
ActiveDocument.Bookmarks("NameBk").Select
FullName = FullName & ""
Selection.TypeText FullName & ""
Else
End If
person. My question is this, how do I remove the extra spaces at the end
before the text is placed in MS Word?
Thank you for your help!
' ********Code Begins ****************
Dim FullName as String
Dim CASELEN as Long
Dim Testname as string
Dim Q as Integer
FullName = CurrentScreenObject.getstring(3, 33, 31)
CASELEN = Len(FullName)
For Q = 1 To CASELEN
Testname = Mid(FullName, Q, 1)
If Testname = " " Then
FullName = Left(FullName, Q - 1)
Exit For
End If
Next Q
If FullName <> "" Then
ActiveDocument.Bookmarks("NameBk").Select
FullName = FullName & ""
Selection.TypeText FullName & ""
Else
End If