J
Johnnyd12
I am trying to write a macro In Word 2003. My goal is to automate
filling a word template called Document 2 with three pieces of data
(access no., Narrative, Report no.) from Report Doc. I want to run my
macro from any Report Doc. All the data starts at character position
40.
I want to read a range in line 2 (access no.) 6 characters in length. I
want to read a separate range in line 4 (narrative) 40 characters in
length. and a third range from line 17( report No.) 12 characters in
length.
Access number is inserted into textbox.doc2(bookmarked as
"Text1")
Narrative is inserted into textbox.doc2 (bookmarked as
"Text15")
Report No. is inserted into textbox.doc2 (bookmarked as
"Text5")
I also want to save filled in template as Report no.
XXXXXXXXXXXXXXXXXXX. doc
I have tried using the clipboard numerous ways but my program will not
"reach down" and choose the correct selection of data and put them in
the right text boxes. (Will the clipboard not let itself be an array?).
When I run my macro It grabs the top choice and fills the corresponding
text boxes with the same data. I know if I create 3 separate range
variables and insert them in the boxes, I will achieve my goal, but I
need help
trying to find the right set of commands to insert in the textbox. Can
anyone assist me with the code commands.This seems to be simple task. I
appreciate any help. Thanks
filling a word template called Document 2 with three pieces of data
(access no., Narrative, Report no.) from Report Doc. I want to run my
macro from any Report Doc. All the data starts at character position
40.
I want to read a range in line 2 (access no.) 6 characters in length. I
want to read a separate range in line 4 (narrative) 40 characters in
length. and a third range from line 17( report No.) 12 characters in
length.
Access number is inserted into textbox.doc2(bookmarked as
"Text1")
Narrative is inserted into textbox.doc2 (bookmarked as
"Text15")
Report No. is inserted into textbox.doc2 (bookmarked as
"Text5")
I also want to save filled in template as Report no.
XXXXXXXXXXXXXXXXXXX. doc
I have tried using the clipboard numerous ways but my program will not
"reach down" and choose the correct selection of data and put them in
the right text boxes. (Will the clipboard not let itself be an array?).
When I run my macro It grabs the top choice and fills the corresponding
text boxes with the same data. I know if I create 3 separate range
variables and insert them in the boxes, I will achieve my goal, but I
need help
trying to find the right set of commands to insert in the textbox. Can
anyone assist me with the code commands.This seems to be simple task. I
appreciate any help. Thanks