Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Task Scheduler IWeeklyTrigger DaysofWeek

Status
Not open for further replies.

Boris10

IS-IT--Management
Jan 26, 2012
97
0
0
KE
Hi Everyone i trying to create a task scheduler programmatically. I am stack on creating a weekly trigger. I am trying to allow the user to select days from monday to sunday. The problem i am having is that i can only create a trigger with one of the 7 days. How can i assign all 7 days to the weekly trigger?

Below is my code that works for one day out of seven:
Code:
            Dim Weekly As TaskScheduler.IWeeklyTrigger
            Weekly = task.Triggers.Create(_TASK_TRIGGER_TYPE2.TASK_TRIGGER_WEEKLY)

            Weekly.Id = "Weekly IAccpacTrigger"
            Weekly.StartBoundary = String.Format("{0:yyyy-MM-dd}", dtDate.Value) & "T" & Format(dtTime.Value, "HH:mm:ss")
            Weekly.DaysOfWeek = 1
            Weekly.Enabled = True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top