View Single Post
 
Old 01-08-2021, 10:38 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Davd,

I just don't see a simple solution. This may work, but in complex documents with things other than text, it might fall over:

Code:
Sub ScratchMacro()
  'A basic Word macro coded by Greg Maxey
  Dim oRng As Word.Range
  Dim lngS As Long, lngE As Long
     Set oRng = Selection.Range
     lngS = Len(ActiveDocument.Range.Text)
     oRng.PasteSpecial DataType:=wdPasteText
     lngE = Len(ActiveDocument.Range.Text)
     oRng.MoveStart wdCharacter, -(lngE - lngS)
     oRng.Select
  lbl_Exit:
     Exit Sub
  End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote