G
Guest
I am trying to export a large number of records one at a time into a word
template .dot file from access. The problem that I am having is that each
time a new document is created from the template I have to click on the
header of the Word application for the code in access to progress. The code
just seems to hand after the document is created. Aside from this
undesirable user intervention the sub-routine seems to work. How do I get
rid of the pause?
I used the following code:
Set objWord = CreateObject("Word.Application")
objWord.Documents.Add "The Path To The Template IS Here", _
NewTemplate:=False, DocumentType:=0)
ObjWord.Application.Visible =True
.....This is where we pause until I click on the Header of the Word App
objWord.Slection.MoveDown Unit:=wdLine, count:=12
The previous line skips past the protected(Form) sections of the document
Fonts are set and the fields are entered here.
objWord.Activedocument.SaveAs "File Path and name"
objWord.ActiveDocument.Close
objWord.Quit
Is there some way for me to give focus to Word from the code in Access
without manually clicking the Word header with each pass of the code?
Thanks,
Michael
template .dot file from access. The problem that I am having is that each
time a new document is created from the template I have to click on the
header of the Word application for the code in access to progress. The code
just seems to hand after the document is created. Aside from this
undesirable user intervention the sub-routine seems to work. How do I get
rid of the pause?
I used the following code:
Set objWord = CreateObject("Word.Application")
objWord.Documents.Add "The Path To The Template IS Here", _
NewTemplate:=False, DocumentType:=0)
ObjWord.Application.Visible =True
.....This is where we pause until I click on the Header of the Word App
objWord.Slection.MoveDown Unit:=wdLine, count:=12
The previous line skips past the protected(Form) sections of the document
Fonts are set and the fields are entered here.
objWord.Activedocument.SaveAs "File Path and name"
objWord.ActiveDocument.Close
objWord.Quit
Is there some way for me to give focus to Word from the code in Access
without manually clicking the Word header with each pass of the code?
Thanks,
Michael