M
Michael
I am trying to insert some records from access into a word template. The
template is protected for forms and contains some drop down boxes. The
problem that I am having is that when the word document is opened the first
drop down recieves focus and the drop down list appears...the code
pauses...but as soon as I mouse click on anything on the screen the code
resumes moving to the end of the document and adding the text, the document
is saved and closed , the next document is created - again requiring user
intervention to click on anything.
I assume the problem lies in the section of code that creates the word
document from access.
'instantiate a new word document from template
set objword = createobject("word.application")
with objword
.documents.add _
strTemplatePath, _
newtemplate:=false, documenttype:=0
.application.visible = true
'move to the entry point and set the font
with .selection
.movedown unit:=wdline, count:=14
'...cycle through tables, insert text, and format text
end with
end with
At first I thought I needed to give focus to word somehow, but when I
realized that clicking on the desktop or the windows task bar caused the code
to resume I became unsure.
I would appreciate any help eliminating this inconvenient pause.
Thanks
-Michael
template is protected for forms and contains some drop down boxes. The
problem that I am having is that when the word document is opened the first
drop down recieves focus and the drop down list appears...the code
pauses...but as soon as I mouse click on anything on the screen the code
resumes moving to the end of the document and adding the text, the document
is saved and closed , the next document is created - again requiring user
intervention to click on anything.
I assume the problem lies in the section of code that creates the word
document from access.
'instantiate a new word document from template
set objword = createobject("word.application")
with objword
.documents.add _
strTemplatePath, _
newtemplate:=false, documenttype:=0
.application.visible = true
'move to the entry point and set the font
with .selection
.movedown unit:=wdline, count:=14
'...cycle through tables, insert text, and format text
end with
end with
At first I thought I needed to give focus to word somehow, but when I
realized that clicking on the desktop or the windows task bar caused the code
to resume I became unsure.
I would appreciate any help eliminating this inconvenient pause.
Thanks
-Michael