Hello,
I am trying to write an Excel vba script which pastes data into a word document. I have already made a great deal of progress by searching this and other forums, but now I seem to be stuck. Maybe one of you can help me out.
Here's how one should be able to use the script:
The user has multiple Excel documents available [which all contain this macro, as they were generated from the same template by a third-party software (LabView)].
The user is already working on a Word document, typing text until he decides that he wants to add some information from one of the Excel sheets. To do this, he changes to Excel, clicks on the button running the script, and the required information is pasted into the Word document at the present cursor position.
Here's what I got so far:
It works fine except that it always inserts the data right at the beginning of the Word document, which is not a big surprise because I have told the script to do so by specifiying range(0,1):
Now how can I find out the current cursor position in the Word document? After doing some research in the Word VBA forums, I tried to use something along the line of
but the Excel VBA script always shows an error message ("Does not support this property or method"). Do you know how to do this?
Thanks in advance,
gonefishing
Bookmarks