11.07.2015 Views

Automate Scheduler Using Macros

Automate Scheduler Using Macros

Automate Scheduler Using Macros

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 3: ObjectsExample 2This example schedules a new task whose results print automatically.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 SubMethod NameCreate<strong>Using</strong>DeleteEditSaveDescriptionCreates a new Schedule object based onan existing Schedule object.Deletes the specified scheduled task.Prevents <strong>Scheduler</strong> from running a taskwhile the task is edited.Saves the changes to a new or changedSchedule object.Property NameCardinalDayCatlogUsrClsCatLogUsrPwCommandFileNameDescriptionSets or returns the specific day of themonth the task runs.Sets or returns the name of the cataloguser class.Sets the password for the catalog userclass.Sets or returns the path and file name forthe command script to run with theSchedule object.<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 17

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

Saved successfully!

Ooh no, something went wrong!