Need help with Printing

J

Joe Cilinceon

This is probably the wrong group, but you have been so helpfull in the past
I though I would ask here.

What I have is Public function that prints Word doc file. Now these are
really just forms we have the tenant's fill out so we pass no data from the
program to it other than the form path and name. The function I've used is
listed below.

Public Function PrintDoc(FileName)

Dim Wordobj As Object
Set Wordobj = CreateObject("Word.Application")
Wordobj.Documents.Open FileName
Wordobj.PrintOut Background:=False
Wordobj.Quit
Set Wordobj = Nothing

End Function

Now I call it by simply doing adding a button with
PrintDoc("Full Path to the file")
Now this is working great but I would like to print more than one copy at a
time. If anyone knows how please help me out.
 
A

Allan Murphy

Joe

You could use a for statement. You will need to capture the number of copies
that are to be printed

then
dim copies as integer

for copies = 1 to (number of copies)
PrintDoc("Full Path to the file")
next copies

number of copies could be a reference to a field on a form etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top