SendKeys problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi folks,

I have Acrobat PDFWriter installed in my system. I used the following code
to print my reports in PDF format. When I ran the code, it produced the
first report with no problem. Then, it poped up a window and waited for the
response and the file name was not what I expected. Could anyone tell me
why? And how to fix it?

Thanks in advance.

Tim.

Public Sub x()

SendKeys "c:\temp\1.pdf" & "{ENTER}", False
DoCmd.OpenReport "1"

SendKeys "c:\temp\2.pdf" & "{ENTER}", False
DoCmd.OpenReport "2"

End Sub
 
The SendKeys method tends to be problematic at best, and should usually be
avoided.

As far as I'm aware, there are more reliable ways of setting the file name
with Acrobat PDFWriter, but unfortunately I don't know them, as I've never
used that product. It probably involves either Automation, or setting a
value in an INI file.
 
Back
Top