Automate Scheduler Using Macros
Automate Scheduler Using Macros
Automate Scheduler Using Macros
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 displays all tasks and allows the user to toggle their holdstatus. All completed tasks will show up as being "on hold". Attempts totoggle the hold status of a completed task will result in an error.Sub Main()Dim objSchedApp As ObjectDim intCounter As IntegerDim strTaskDescription As StringSet objSchedApp = CreateObject("CognosBatcher.Application")For intCounter = 1 To objSchedApp.Schedules.CountWith objSchedApp.Schedules.Item(intCounter)If .Hold = True ThenstrQualifier = " is "ElsestrQualifier = " is not "End IfintResponse = MsgBox("The following task" & strQualifier & _"on hold:" & Chr(13) & .ScheduleDescription Chr(13) & _"Do you wish to change this?",292, "Toggle Hold status")If intResponse = 6 Then'toggle the current hold status; if this is a completed'task,this will not work, as completed tasks cannot be'editted..Edit.Hold = Not(.Hold).SaveEnd IfEnd WithNext intCounterSet objSchedApp = NothingEnd Sub<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 77