building delay

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Hi,
I've got this code for making a mailing. When I use this command with a
large mailing, the memory of my printer runs full. So I have to build in a
delay.
Does anyone know how?

Thanks,
Martin

part of the code I use:

'===start
If Not rstVerzenden.EOF Then

Set oApp = GetObject(, "Word.Application")

Set rstGeadresseerden = db.OpenRecordset("tblGeadresseerden",
dbOpenDynaset)

rstVerzenden.MoveFirst



Do Until rstVerzenden.EOF



oApp.Documents.Add Template:="c:\tempdoc\mailingPE.dot"



With oApp

.ActiveDocument.Bookmarks("txtDatum").Range = Me.txtDatum

.ActiveDocument.Bookmarks("txtBetreft").Range = Me.txtBetreft

.ActiveDocument.Bookmarks("txtBody").Range = Me.txtBody



With oApp

.ActiveDocument.PrintOut Background:=False

.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges

End With



End With

rstVerzenden.MoveNext

Loop

oApp.Quit wdDoNotSaveChanges

End If



'===end
 
Not quite the answer, but might solve your problem. You are opening a new
document based on your template, for each record in the recordset. Can you
place each record in a separate page within the one document - ie create a
page feed after each record. Does this achieve the same result ?


--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Well, its a thought. I'll try that.
Any ideas how to do that?

Thanks for answering,
Martin
 
I havent used Word automation much, but surely there is a newpage command.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
It would be InsertBreak or somesuch.

TC


Adrian Jansen said:
I havent used Word automation much, but surely there is a newpage command.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
create with build
 
Back
Top