GetSelectedRowsAlarmInfo Method Example

The following example obtains the alarm information (including shelving) for the for the selected alarms in the Alarm Summary object, AlarmSummaryOCX1. It then displays a message with the Shelve Status and Remaining Duration for each alarm.

Public Sub HandleMultipleRowAlarmShelveInfo()

Dim AppObj As Object

Dim PictureObj As Object

Dim CurrentObj As Object

 

Dim NumRows As Long

Dim bAck As Variant

Dim sHandle As Variant

Dim sArea As Variant

Dim sDateIn As Variant

Dim sDateLast As Variant

Dim sTimeIn As Variant

Dim sTimeLast As Variant

Dim sNode As Variant

Dim sTag As Variant

Dim sPriority As Variant

Dim sStatus As Variant

Dim sDesc As Variant

Dim sValue As Variant

Dim sExt1 As Variant

Dim sExt2 As Variant

Dim sUser1 As Variant

Dim sUser2 As Variant

Dim FlexData1 As Variant

Dim FlexData2 As Variant

Dim FlexData3 As Variant

Dim FlexData4 As Variant

Dim FlexData5 As Variant

Dim FlexData6 As Variant

Dim FlexData7 As Variant

Dim FlexData8 As Variant

Dim Shelvable As Variant

Dim ShelveRemDuration As Variant

Dim Reserved1 As Variant

Dim Reserved2 As Variant

If TypeName(Application) = "CFixApp" Then

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

If TypeName(CurrentObj) = "AlarmSummaryOCX" Then

If CurrentObj.Name = "AlarmSummaryOCX1" Then

CurrentObj.GetSelectedRowsAlarmInfo NumRows, bAck, sHandle, sArea, sDateIn, sDateLast, sTimeIn, sTimeLast, sNode, sTag, sPriority, sStatus, sDesc, sValue, sExt1, sExt2, sUser1, sUser2, FlexData1, FlexData2, FlexData3, FlexData4, FlexData5, FlexData6, FlexData7, FlexData8, Shelvable, ShelveRemDuration, Reserved1, Reserved2

' MsgBox "Shelvable Status: " & Shelvable

' MsgBox "Remaining Duration: " & ShelveRemDuration

Exit Sub

End If

End If

Next

End Sub