Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-12-2020, 03:21 PM
macropod's Avatar
macropod macropod is offline Selection object and its Range property Windows 7 64bit Selection object and its Range property Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Distribute text in one cell across a range of cells (overcoming selection.range.cells.count bug) slaycock Word VBA 0 02-18-2017 07:00 AM
Selection object and its Range property Working with Selection.range. PRA007 Word VBA 2 02-19-2016 12:52 AM
Selection or Range Tommes93 Word VBA 1 04-10-2014 02:50 AM
Selection object and its Range property Use of Range Object Question jsb73 Word VBA 6 08-14-2012 07:35 PM
Cannot access most of property of MailItem object on Windows Server 2008 64 bit tz900 Outlook 0 04-10-2012 12:55 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:37 AM.


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