Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-01-2018, 02:52 AM
gloub gloub is offline Add an s at the end of the current word Windows 7 64bit Add an s at the end of the current word Office 2003
Novice
Add an s at the end of the current word
 
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
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add an s at the end of the current word Problem getting filename and directory of current word doc. gazeranco Word VBA 8 10-29-2016 12:13 AM
Add an s at the end of the current word Where can I see the current hidden word properties values in Word 2007? pstein Word 3 08-15-2012 05:08 AM
Add an s at the end of the current word How to call current PC date and/or current PC year KIM SOLIS Excel 2 11-04-2011 06:09 PM
Add an s at the end of the current word What “style” is used by the current line. Word 2007. persist Word 2 04-07-2010 09:52 PM
Add an s at the end of the current word Auto insert current month's name and current year Styler001 Word 4 01-25-2010 06:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:13 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft