View Single Post
 
Old 07-31-2019, 06:10 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

OP,


I'm not a computer scientists, but something like this:

Code:
Sub ScratchMacro()
'oRng is a named variable.  I just made it up using o meaning object and Rng meaning range
'Dim declares a named variable and defines the data type in the Word object model.  In this case
'a Word.Range
Dim oRng As Word.Range
  'Use Set to set the range object to a range in the document e.g., the Selection.Range
  Set oRng = Selection.Range
  'Paste is a method of a range object and puts the contents in and expands the range.
  oRng.Paste
  'Select is a method of a range object and selects the defined range.
  oRng.Select
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote