View Single Post
 
Old 04-12-2020, 03:21 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You can resolve the inconsistency between 'Texte de la sélection' and 'Texte de la plage' by changing:
With Selection
to:
With Selection.Range

The inconsistency between the 'Texte de la sélection' and 'Texte de la plage' on the one hand and the 'Premier Caractère de la sélection' and 'Premier Caractère de la plage' on the other are just a quirk of how VBA works. You can resolve those issues by testing the selection type (or by subtracting the range end from its start) and, if Selection.Type < 2, or the range length is 0, not reporting CharacterEnAsci(.Characters(1)).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote