With Selection
.Expand Unit:=wdWord
.MoveEndWhile Cset:=" ", Count:=wdBackward
.InsertBefore Text:="("
.InsertAfter Text:=")"
End With
It's not perfect - put the cursor to the left or right of punctuation and it
will parenthesise the punctuation - but it would take more complex code to
trap that.
--
Enjoy,
Tony
> With Selection
> .Moveend Unit:=wdWord, Count:=1
[quoted text clipped - 6 lines]
> But it included the space behind the word.
> any way to improve it?
ykchanaed - 21 Oct 2005 15:56 GMT
Dear Tony,
This works fine with me.
Thanks a lot.
> With Selection
> ..Expand Unit:=wdWord
[quoted text clipped - 20 lines]
> > But it included the space behind the word.
> > any way to improve it?