Sending keys to DocuCom PDF Driver

T

TroyH

This has me stumped. Can someone help me. I'm trying to pass a variable
FILENAM to a dialog box.

This is the code I am using:

Dim FILENAM
Sheets("Non-Form Cover Sheet").Select
ActivePrinter = "DocuCom PDF Driver on LPT1:"
FILENAM = "S:\email\Test"
(1) SendKeys "{Enter}"
Application.SendKeys FILENAM, True
(2) SendKeys "{Enter}"
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, _
Collate:=True, ActivePrinter:="DocuCom PDF Driver on LPT1:"
Application.Wait (Now + TimeValue("0:00:01"))
Testing.Hide
Unload Testing

When SendKeys "{Enter}" is position (1), the program runs completely but
FILENAM does not get passed to the dialog box, but if SendKeys "{Enter}" is
in position (2) FILENAM is passed but it stops. I've added a chr(13) to the
FILENAM and even tried Application.SendKeys FILENAM & "{ENTER}", True Nothing
works.
 

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