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 6: PropertiesAccessRead/WriteExampleThis example schedules a new task, and sets it to publish the results toHTML documents, including a table of contents with page numbers.Sub Main()Dim objSchedApp As ObjectDim objNewTask As ObjectSet objSchedApp = CreateObject("CognosBatcher.Application")Set objNewTask = CreateObject("CognosBatcher.Schedule")With objNewTask.ScheduleDescription = "My HTML task".ScheduleName = "C:\Program Files\Cognos\Impromptu 5.0\" & _"Imp.5.0 Samples\Reports\Annual Product Sales.imr".ScheduleType = 0.RunAtHour = 18.RunAtMin = 45.EffectiveFrom = Date'set up the task to publish its results to files in HTML format.PublishHTML = True'HTML Directory must be a valid path.HTMLDirectory = "C:\HTML_Documents"'HTMLPrefix will be placed in the file name for each'of the HTML files produced.HTMLPrefix = "IH_"'include a table of contents.IncludeTOC = True'include page numbers (Hex 02).TOCOptions = &H02.SaveEnd WithSet objNewTask = NothingSet objSchedApp = NothingEnd Sub<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 139

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

Saved successfully!

Ooh no, something went wrong!