如何根据一个关键字在webtable中选择一个checkbox

上一篇 / 下一篇  2006-12-19 22:10:17

我写了一个小的脚本去实现如何在webtable中随意选择一个checkbox

Sub WebTableSelectCheckbox (WebTblObj, ItemToLocate, ItemColumn, ChkBoxCol)
   ' Total number of rows in html_table
   TotalRows = WebTblObj.RowCount 

   For row= 3 To TotalRows
      ' Retrieve the item from the specified column
      ValueShown = WebTblObj.GetCellData(row,ItemColumn)

           If (ItemToLocate = Trim(ValueShown)) Then
         Set ChkBoxObj = WebTblObj.ChildItem(row, ChkBoxCol,"WebCheckBox", 0)
         ChkBoxObj.Set "ON"
         Exit For
      End If
   Next
End Sub

调用方式:

Set MyObj = Browser("Multiple Oper").Page("Multiple Oper").WebTable("Direct Reports")

WebTableSelectCheckbox MyObj, "323214", colEMPID, 1


TAG:

 

评分:0

我来说两句

日历

« 2024-05-07  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 18561
  • 日志数: 11
  • 建立时间: 2006-12-04
  • 更新时间: 2007-05-24

RSS订阅

Open Toolbar