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 5: MethodsDiscussionThe default mail standard is MAPI. However, you can modify the Sendcapability to use your own multi-use OLE component so you can sendinformation via your own system. For more information, see <strong>Scheduler</strong>online Help.ParameterFilenameDescriptionOptional (for remote result sets only).Specifies the filename of the exportedresults.Type: StringReturn TypeEmptyExampleThis example enables the user to send the results of a completed taskthat generated a snapshot or exported results.Sub Main()Dim objSchedApp As ObjectDim objCompletedTasks As ObjectDim objCompletedTask As ObjectDim intCounter As IntegerDim strTaskDescription As StringSet objSchedApp = CreateObject("CognosBatcher.Application")Set objCompletedTasks = objSchedApp.Completed'this loop will start with the most recently completed tasksFor intCounter = objCompletedTasks.Count To 1 Step -1With objCompletedTasks.Item(intCounter)Set objCompletedTask = _objCompletedTasks.Item(intCounter).SchedulestrTaskDescription = objCompletedTask.ScheduleDescriptionIf .Schedule.CreateSnapshot = True Or _.Schedule.ExportAs = True ThenintResponse = MsgBox("Send the results of this task" & _"?" & Chr(13) & strTaskDescription, _292, "Send Results")If intResponse = 6 Then'send the results of the task.SendResultsEnd IfEnd IfEnd WithNext intCounterSet objCompletedTask = NothingSet objCompletedTasks = NothingSet objSchedApp = NothingEnd Sub<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 37

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

Saved successfully!

Ooh no, something went wrong!