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!

Impromptu Macro Writing

Status
Not open for further replies.

FirstTimeMacroHELP

Technical User
Jun 17, 2013
5
GB
Hello,

I am writing a macro to automate a Letter report and I can't seem to get the cascading prompt windows to work properly.
How do I get the macro to press OK to get from one Prompt window to the next.

I hope this makes sense,

Thanks,

Becca
 
This is the current Macro I have:

Dim ImpAppObject as Object
Dim ImpRepObject as Object
Dim PDFPubObject as Object
Sub Main()
Set ImpAppObject = CreateObject("Impromptu.Application")
ImpAppObject.OpenCatalog "\\csdpr15ap\codadir\Impromptu\codalive.cat", "Creator" ,"CODA500","reportwriter","ReportWriter"
Set ImpRepObject = ImpAppObject.OpenReport("\\csdpr15ap\codadir\Impromptu\Exchequer\Reminder Letter Level 1a.imr","CORE|14|CORE1/STILLR01/BL| : ALL")
ImpRepObject.RetrieveAll
Set PDFPubObject = ImpRepObject.PublishPDF
PDFPubObject.Publish "\\cs\groups\Finance\Exchequer\Rebecca\Reminder Letter Level 1a Pat.pdf"
ImpRepObject.CloseReport
ImpAppObject.Quit
Set ImpRepObject = Nothing
Set ImpAppObject = Nothing
End Sub

Between CORE and 14 there is a change in windows, if you are running it manually you have to click OK. Does anyone know how I can get it to do it itself?

Thanks
 
Try using the SENDKEYS command

Code:
[...]
Set ImpRepObject = ImpAppObject.OpenReport("\\csdpr15ap\codadir\Impromptu\Exchequer\Reminder Letter Level 1a.imr","CORE|14") 
SendKeys "{Enter}"+ "|CORE1/STILLR01/BL| : ALL", True
[...]

SENDKEYS is a bit of a fudge, but may solve your issue.
See here for IBM example:


soi là, soi carré
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top