Microsoft Internet Security and Acceleration Server 2000

Adding a Schedule Using Visual Basic

The following is a portion of Visual Basic code that adds a new schedule called "Extended Work Hours", which includes all hours on all days:

Dim objFPC As New FPCLib.FPC
' declare schedule collection
Dim MySchedules As FPCSchedules
' declare schedule object
Dim objNewSchedule As FPCSchedule
' get the schedule collection of the current array
Set MySchedules = objFPC.Arrays.GetContainingArray.PolicyElements.Schedules
' Add new Schedule 
Set objNewSchedule = MySchedules.Add("Extended Work Hours")
' Set the Schedule days
objNewSchedule.Set fpcALL_WEEK, fpcALL_DAY
' save your changes
MySchedules.Save

Note that the changed schedule is not saved to persistent storage until the last line of code, where the Save method is called.

See Also

FPCSchedule, Modify a Schedule