I am attempting to write a macro on an excel worksheet that has an embedded Word object. I would like the Excel macro to open the Word doc, copy highlighted text in the Word doc to the Office clipboard and then return back to cell A1 in the Excel worksheet. I believe this involves combining the Word VBA with the Excel VBA but I'm not sure how to make that work.
For the Excel macro, starting in cell A1, it's just a double click on the Word object to open it for editing and then going back to cell A1 on the Excel worksheet.
Sub Macro1()
ActiveSheet.Shapes.Range(Array("Object 1")).Select
Selection.Verb Verb:=x1Primary
Range ("A1").Select
End Sub
The macro in Word to simply copy text that was highlighted is:
Sub Macro1()
Selection.Copy
End Sub
The question is, how do I insert or combine the Word macro within the Excel macro so I can run the macro on the Excel worksheet and end up with the text copied from the Word doc to the Office clipboard for use to paste anywhere I need to put it with a simple "Ctrl V?"
I can't imagine that this combination is too difficult but I certainly do not how to do it. Any thoughts would be much appreciated Thanks!
For the Excel macro, starting in cell A1, it's just a double click on the Word object to open it for editing and then going back to cell A1 on the Excel worksheet.
Sub Macro1()
ActiveSheet.Shapes.Range(Array("Object 1")).Select
Selection.Verb Verb:=x1Primary
Range ("A1").Select
End Sub
The macro in Word to simply copy text that was highlighted is:
Sub Macro1()
Selection.Copy
End Sub
The question is, how do I insert or combine the Word macro within the Excel macro so I can run the macro on the Excel worksheet and end up with the text copied from the Word doc to the Office clipboard for use to paste anywhere I need to put it with a simple "Ctrl V?"
I can't imagine that this combination is too difficult but I certainly do not how to do it. Any thoughts would be much appreciated Thanks!