Hi
I have this code to build a report in Word from Access, my problem is that
evry time i run it, it opens a new Word instance.
Is there any way to open new Word only if it's not opened?
Set qdf = CodeDb.QueryDefs("Comp")
Set rst = qdf.OpenRecordset()
Set objword = GetObject("", "Word.Application")
Do Until rst.EOF
With objword
.Visible = True
.Documents.Add Template:=("\\Ilis\Complaints\Complaint.dot")
.Selection.GoTo Name:=("CurrentID")
.Selection.TypeText Text:=rst![CurrentID]
.
.
.
End With
rst.MoveNext
Loop
TIA
I have this code to build a report in Word from Access, my problem is that
evry time i run it, it opens a new Word instance.
Is there any way to open new Word only if it's not opened?
Set qdf = CodeDb.QueryDefs("Comp")
Set rst = qdf.OpenRecordset()
Set objword = GetObject("", "Word.Application")
Do Until rst.EOF
With objword
.Visible = True
.Documents.Add Template:=("\\Ilis\Complaints\Complaint.dot")
.Selection.GoTo Name:=("CurrentID")
.Selection.TypeText Text:=rst![CurrentID]
.
.
.
End With
rst.MoveNext
Loop
TIA