Using SendKeys and Openreports

S

Stan

I have created a macro that generates a report to a PDF
file using Adobe. I use the Sendkeys function to name the
files. My problem is that the send key function is not
always sending the full string. I use the sendkeys
function first and then the Openreport function. I tried
the wait functing in sendkeys but that does not work. How
can I program this to send the full string 100% of the
time.
 
S

Steve Schapel

Stan,

The SendKeys action is notoriously unreliable. Where is the SendKeys
supposed to be sending the keystroked to? Can you please give more
precise details of what you are doing, and how you are going about
creating the pdf file?
 
S

Stan

I am using the openreport function to open a report that
the default printer is set to the Adobe Acrobat Distiller.
When the report run it opens the save window for the file.

I am trying give each report a user name. I am filtering
each report by user.
 
S

Steve Schapel

Stan,

Thanks for the further clarification. I would not advise doing it this
way, I don't think you could get it working reliably. I recommend
outputting the report to a default file name. I don't know whether
Distiller offers this option... I would presume it does, but otherwise
there are other pdf writers, cheap or free, that do. And then rename
the file after it is created to the required name. As far as I know,
this second step is not possible with a macro. You will need a vba
procedure which includes a line like this...
Name "C:\YourFolder\DefaultName.pdf" As "C:\YourFolder\UserName.pdf"
 

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