![]() |
|
#1
|
|||
|
|||
![]()
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 |
#2
|
|||
|
|||
![]()
Thanks Greg for your quick reply.
What I was wondering was at what point does the code say to select what had just been pasted. Now I understand much better ![]() |
![]() |
Tags |
copy and paste, text selection |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to find text in between two characters and then format selected text? | qcom | Word | 5 | 02-19-2015 11:23 PM |
![]() |
marksm33 | Word VBA | 3 | 01-15-2015 05:59 PM |
![]() |
esteban | Word | 7 | 05-25-2012 04:34 AM |
![]() |
Tracy | Word | 2 | 09-11-2011 07:25 AM |
Selected text and logo in one macro | marijke | Word VBA | 0 | 08-24-2009 07:01 AM |