Jun said:
How do you get the previous character where the cursor is placed?
I've tried using Word's goto but it doesn't seem to work.
Thanks.
Hi Jun
Besides the fact that Selection.GoTo is a nasty kluge, you really shouldn't
move the selection around while the user is looking at the screen. Instead,
use a Range object. There are several ways to do it, but this is probably
the quickest:
Dim oRg As Range
' if Selection.Start = 0 then there isn't any previous char
If Selection.Start > 0 Then
Set oRg = ActiveDocument.Range( _
Selection.Start - 1, Selection.Start)
MsgBox oRg.Text
End If
It's possible that the "character" before the selection is a graphic, a
table, or some other non-text item. Be sure to allow for that in your code.