PDA

View Full Version : [SOLVED:] Copy text between documents



elmnas
07-03-2014, 12:16 AM
Hello guys,

I am trying to figure out how to copy the text that my macroscript marks green:
into a another open active document,
between 2 linebreaks,

Can someone help me out?

See code snipet below,




Sub Test()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "Claims"
While .Execute
oRng.MoveEndUntil Chr(11)
oRng.MoveEnd wdCharacter, 1
oRng.MoveEndUntil Chr(11)
oRng.HighlightColorIndex = wdBrightGreen
oRng.Collapse wdCollapseEnd
Wend
End With
End Sub

Thank you in advance

Cheers

Elmnas