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: PropertiesSharedAs PropertySyntaxCompletedJob.SharedAsApplies ToCompletedJobDescriptionReturns the last exported file name and location of the result set, if any.DiscussionUse this property to determine the last shared name of the result set.TypeStringAccessReadExampleThis example loops through all completed tasks and displays those thatcontain the shared file name and location in a message box.Sub Main()Dim objSchedApp As ObjectDim objCompletedTasks As ObjectDim objCompletedSchedule As ObjectDim intCounter As IntegerSet objSchedApp = CreateObject("Cognosbatcher.Application")Set objCompletedTasks = objSchedApp.CompletedFor intCounter = 1 To objCompletedTasks.CountSet objCompletedSchedule = objCompletedTasks.Item(intCounter)'check the SharedAs propertyIf len(trim(objComletedSchedule.ShareAs))> 0 ThenMsgBox "Task: " & _objCompletedSchedule.Schedule.ScheduleDescription & _chr(13) "Share Name: " & _objCompletedTasks.Item(intCounter).SharedAsEnd IfNext intCounterSet objCompletedSchedule = NothingSet objCompletedTasks = NothingSet objSchedApp = NothingEnd Sub132 <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!