I would like to step through a document until a full stop is found and
then insert a character IF the next character is a space.
So I look for a "." with Selection.Find, but how could I proceed then?
Does Word XP VBA have a built-in function to evaluate the character next
to the position where the Find statement brings me (the selection
containing the full stop)?
Best,
ANDy
--
Dave Lett - 06 Jan 2005 13:48 GMT
Hi Andy,
You might find the following useful:
Dim oRng As Range
Set oRng = Selection.Range
oRng.Collapse Direction:=wdCollapseEnd
oRng.MoveEnd unit:=wdCharacter, Count:=1
If oRng.Text = Chr(32) Then
MsgBox "Yes, this is a space."
End If
HTH,
Dave
> I would like to step through a document until a full stop is found and
> then insert a character IF the next character is a space.
[quoted text clipped - 8 lines]
> ANDy
> --
Helmut Weber - 06 Jan 2005 14:11 GMT
Hi Andy,
Msgbox Selection.Next
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/