Automate Scheduler Using Macros
Automate Scheduler Using Macros
Automate Scheduler Using Macros
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 6: PropertiesPrintCopies PropertySyntaxSchedule.PrintCopiesApplies ToScheduleDescriptionSets or returns the number of copies of a <strong>Scheduler</strong> report to print.DiscussionUse this property only when the PrintResults property is set to True. Thevalues for this property are 1-999.TypeIntegerAccessRead/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 Sub<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 103