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: 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 SubRecurCyc PropertySyntaxSchedule.RecurCycApplies ToScheduleDesriptionSets or returns the frequency number for a recurring task regardless ofunit.112 <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!