View Single Post
 
Old 02-01-2018, 02:52 AM
gloub gloub is offline Windows 7 64bit Office 2003
Novice
 
Join Date: Feb 2018
Location: Paris, France
Posts: 29
gloub is on a distinguished road
Default Add an s at the end of the current word

Hi !
(this is my 1st message ever on this forum !)


I'm trying to do a simple thing, but I' missing something : I want to add an "s" at the end of the current word.

I wrote a macro to do this :
Code:
Sub Pluriel()
' ALT + S
    Application.Selection.Words(1).Select
    Selection.MoveRight Unit:=wdCharacter, Count:=1
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    Selection.TypeText Text:="s"
End Sub
It works fine, except when there's a coma or a dot right after the word, or if the current word is the last of a paragraph...

For instance :
assiette >>> assiettes = fine (provided the word is in the middle of a sentence)
but :
assiette, >>> assiettse, = wrong

How should I proceed to avoid this ?


Many thanks !
Reply With Quote