|
ED
|
avaliable
|
RT
|
not used
|
New Items like AlarmClasses can be created.
'Create/Change 3 AlarmClasses... Sub CreateAlarmClasses() Dim zPRJ As Project Dim i As Integer Dim bResult As Boolean Set zPRJ = MyWorkspace.ActiveDocument For i = 1 To 3 'check if AlarmClass exists If CInt(zPRJ.DynProperties("AlarmClasses[-1]")) < i Then 'Create new AlarmClass bResult = zPRJ.CreateDynProperty("AlarmClasses") If bResult Then zPRJ.DynProperties("AlarmClasses[" & i - 1 & "].Name") = "Class_" & i zPRJ.DynProperties("AlarmClasses[" & i - 1 & "].Color") = RGB(120 + ((i - 1) * 63), 0, 0) zPRJ.DynProperties("AlarmClasses[" & i - 1 & "].Description") = "created by VBA" End If Else 'change existing classes zPRJ.DynProperties("AlarmClasses[" & i - 1 & "].Name") = "Class_" & i zPRJ.DynProperties("AlarmClasses[" & i - 1 & "].Color") = RGB(120 + ((i - 1) * 63), 0, 0) zPRJ.DynProperties("AlarmClasses[" & i - 1 & "].Description") = "created by VBA" End If Next i End Sub