I've got a Word (2010) macro that helps the user copy and paste content from a source document to a destination document. With the 2 docs in side-by-side mode, they first select text and click a button which copies the selection and gives them a dialog telling them to put their insertion point in the destination document and click the paste button.
After checking to make sure they are in the destination document, the macro pastes the selected text into the destination doc, at the same time formatting it to match the normal style of the destination doc. Then it goes back to the original selection in the sourcedoc and changes the copied text to strikeout so the user knows it has been copied.
Works like a charm with one exception: In the destination doc, it leaves my insertion point at the START of the pasted text, but I want it to be at the END of the pasted text. I've tried a few things and can't get it to do that. I borrowed parts of this code so I'll admit I don't know exactly how the paste and format part works, which is why I'm struggling with this I'm sure.
Private Sub PasteButton_Click()
If Selection.Document = copydoc Then
MsgBox "please select a location in the Desination document."
Dim oRng As Range, oStart As Range
Set oRng = Selection.Range
Set oStart = Selection.Range
.PasteSpecial DataType:=wdPasteRTF, Placement:=wdInLine
.Start = oStart.Start
.Font.Name = ActiveDocument.Styles("Normal").Font.Name
.Font.Size = ActiveDocument.Styles("Normal").Font.Size
.Font.ColorIndex = ActiveDocument.Styles("Normal").Font.ColorIndex
Selection.Font.StrikeThrough = wdToggle
Selection.MoveRight unit:=wdCharacter, count:=1
I've tried oRng.MoveEnd or Selection.MoveEnd, but they seem to be referencing the original selection in the sourcedoc.
Can anybody help me figure out how to end up at the end of the pasted selection?