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: PropertiesExampleThis example demonstrates the use of the PurgeComplete andPurgeCompletedAfter properties of the Options objectSub Main()Dim objSchedApp As ObjectDim objOptions As ObjectDim intResponse As IntegerDim strQualifier As StringSet objSchedApp = CreateObject("Cognosbatcher.Application")Set objOptions = objSchedApp.OptionsWith objOptions'PurgeCompleted is a Boolean propertyIf .PurgeCompleted ThenstrQualifier = ""ElsestrQualifier = " not"End IfintResponse = MsgBox("<strong>Scheduler</strong> currently is" & _strQualifier " configured to automatically purge " & _"completed tasks. Do you wish to toggle this " & _"setting?",259,"Toggle automatic purging?")If intResponse = 6 Then.PurgeCompleted = Not(.PurgeCompleted)End IfIf .PurgeCompleted Then'PurgeCompletedAfter is an integer value.PurgeCompletedAfter = Val(InputBox("<strong>Scheduler</strong> is " & _"currently configured to purge completed tasks " & _"automatically after" Str(.PurgeCompletedAfter) & _"days. Type in a new value or press ENTER to accept the" & _"current value.", _"Automatic purging of completed tasks", _.PurgeCompletedAfter))End If.SaveEnd WithSet objOptions = NothingSet objSchedApp = NothingEnd Sub110 <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!