Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print existing PDF in Access

Status
Not open for further replies.

demills

Programmer
Jun 14, 2002
10
CA
Hi All -

Am having a problem printing a large collection of existing PDF files in Access. Have used the folowing code in a loop feeding it filenames and things seem to work ok, except not all PDF files print. It tends to print a group of say 4 or 5 documents, skips some, prints some more, and so on. It also leaves multiple copies of Adobe open but still closes the majority of them. I'm thinking it must have something to do with the speed it is sending the commands to Adobe. I tried setting the wait arguments for sendkeys to true and putting a delay loop in, nothing seemed to help. Anyone have any ideas?

rs.MoveFirst
While i <= lNumrec
sFilePath = "\\glfsmalld2\MapX\Images\" + rs.Fields("clientnum").Value + "\"

sFileName = rs.Fields("clientnum").Value & rs.Fields("date").Value & ".PDF"

'print PDF
Application.FollowHyperlink sFilePath + sFileName
SendKeys "%(FP)"
SendKeys "~", True
SendKeys "^q" 'Quits Adobe

i = i + 1
rs.MoveNext
Wend
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top