Simple VBA macro to copy text from docA to docB

Hi, 

I am using this simple VBA macro to extract the text is select with the mouse from the active document into a new document

strMytext = Selection.Range.Text
Selection.Copy
Documents.Add
Selection = strMytext

The problem is that when I select text from more than one row in a Word table, the script also copies the text that is present into columns I have not selected.

I have tried using 

strMytext = Selection.Text

instead, but then the script only copies the text from the first row of the selection (it does not copy text from multiple manually-selected rows in the table(s)

How do I copy only the text in the columns AND rows I have selected?

Thanks in advance for your help!

 

Question Info


Last updated October 5, 2021 Views 9 Applies to: