11.07.2015 Views

Automate Scheduler Using Macros

Automate Scheduler Using Macros

Automate Scheduler Using Macros

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6: PropertiesPrinterName PropertySyntaxSchedule.PrinterNameApplies ToScheduleDescriptionSets or returns the selected printer name from the printers visible to thecomputer.DiscussionThe name of the printer must be valid. The maximum length of thisproperty is 255 characters.TypeStringAccessRead/WriteExampleThis example schedules a new task whose results will be printedautomatically.Sub Main()Dim objSchedApp As ObjectDim objNewTask As ObjectSet objSchedApp = CreateObject("CognosBatcher.Application")Set objNewTask = CreateObject("CognosBatcher.Schedule")With objNewTask.ScheduleDescription = "My print task".ScheduleName = "C:\Program Files\Cognos\Impromptu 5.0\" & _"Imp.5.0 Samples\Reports\Annual Product Sales.imr"'single execution.ScheduleType = 0.RunAtHour = 18.RunAtMin = 45.EffectiveFrom = Date'print the output of the report.PrintResults = True'PrinterName must be a valid printer available on this machine.PrinterName = "HP LaserJet 5Si/5Si MX"'print only one copy.PrintCopies = 1.SaveEnd WithSet objNewTask = NothingSet objSchedApp = NothingEnd Sub106 <strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!