Hi Guys,
I'm having trouble getting information from a word document. I want to copy line by line from the word document and paste each into different windows in ProComm. I've created a macro in word that copies a line and moves the cursor to the next line. I'm attempting to connect to word, call the macro, and paste the info into ProComm and give a RETURN. I can get it to all work but when I run the script again it continues to paste the same line. I found if I Alt+Tab to the Word window then back to ProComm and run the script again it will paste the next line, but what a pain. Any suggestions regarding how I can fix this?
And please remember I’m no programmer.
proc main
long LinkVar, SystemVar
if ddeinit SystemVar "msWORD" "System"
if ddeinit LinkVar "msWORD" "TESTDDEscripts.doc"
ddeexecute LinkVar "Copy_Next_Line[Copy_Next_Line()]"
ddeunadvise LinkVar "TESTDDEscripts.doc"
ddeterminate LinkVar
ddeterminate SystemVar
pastetext
transmit "^M"
else
errormsg "Couldn't establish DDE link to Document!"
endif
else
errormsg "Couldn't establish DDE link to Word!"
endif
endproc
Thanks in advance.
VLG711
I'm having trouble getting information from a word document. I want to copy line by line from the word document and paste each into different windows in ProComm. I've created a macro in word that copies a line and moves the cursor to the next line. I'm attempting to connect to word, call the macro, and paste the info into ProComm and give a RETURN. I can get it to all work but when I run the script again it continues to paste the same line. I found if I Alt+Tab to the Word window then back to ProComm and run the script again it will paste the next line, but what a pain. Any suggestions regarding how I can fix this?
And please remember I’m no programmer.
proc main
long LinkVar, SystemVar
if ddeinit SystemVar "msWORD" "System"
if ddeinit LinkVar "msWORD" "TESTDDEscripts.doc"
ddeexecute LinkVar "Copy_Next_Line[Copy_Next_Line()]"
ddeunadvise LinkVar "TESTDDEscripts.doc"
ddeterminate LinkVar
ddeterminate SystemVar
pastetext
transmit "^M"
else
errormsg "Couldn't establish DDE link to Document!"
endif
else
errormsg "Couldn't establish DDE link to Word!"
endif
endproc
Thanks in advance.
VLG711