Project.CreateDynProperty



CreateDynProperty(bsPath As String) As Boolean

Parameters

bsPath As String
DynProperty as String to be created.
ED
avaliable
RT
not used

Remarks

New Items like AlarmClasses can be created.


Sample:


'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

See Also

Project