Delays and Printing

G

Guest

Good morning,
I'm still working on printing out an Adobe Acrobat file. But this time, I'm
reading it as an OLE object from within a form. For some reason, I cannot
get it to print as a part of a report...

Anyway (disclaimer: I know this goes against the developers' grain, so I'm
happy to try the "preferred" method if someone explains it to me), here's my
code for within the form:


Private Sub Form_Open(Cancel As Integer)
dim intcount as double
Me.WebBrowser0.Navigate "FILE:///C:/fw9.pdf"
for intcount = 1 to 10000000
next intcount
sendkeys "^P"
for intcount = 1 to 100000
next intcount
sendkeys "{ENTER}"
End Sub

The sendkeys statements never actually do anything. (or am I THAT
impatient?). Can someone please help? I know that if I do the ^P too soon,
I'll get the Access Print button equivalent. I need to wait until the
Acrobat Reader OLE has the focus and then the ^P will run that instead.

Thank you!
Derek
 
G

Guest

Good morning, all.
Just want to let you all know that I was able to establish a simple
solution.

My code follows:

Private Sub Form_Current()
Me.WebBrowser0.Navigate "http://www.irs.gov/pub/irs-pdf/fw9.pdf"
End Sub

Private Sub Form_Timer()
SendKeys "^p", True
SendKeys "{ENTER}", True
Me.TimerInterval = 0
Me.OnTimer = "" ' These previous 2 lines remove the 'repeat' of the OnTimer
event
DoCmd.Close
End Sub

Thank you!
Derek
 

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