ShelveAlarm Method Example

The following example shelves an alarm in the Alarm Summary object, AlarmSummaryOCX1, with a given duration.

Public Sub ShelveAnAlarm(NodeName As String, TagName As String, ShelveDuration As Long)

Dim AppObj As Object

Dim PictureObj As Object

Dim CurrentObj As Object

 

nShelveTime = 100

If TypeName(Application) = "CFixApp" Then

' running in the workspace

Set AppObj = Application

Else

Set AppObj = App

If AppObj Is Nothing Then

Exit Sub

End If

End If

Set PictureObj = AppObj.ActiveDocument

For Each CurrentObj In PictureObj.Page.ContainedObjects

' Search for alarm ocx control in the display

If TypeName(CurrentObj) = "AlarmSummaryOCX" Then

If CurrentObj.Name = "AlarmSummaryOCX1" Then

CurrentObj.ShelveAlarm NodeName, TagName, ShelveDuration

Exit Sub

End If

End If

Next

End Sub