---
title: "WebTable下自动Click Link"
author: "jerome_wang"
date: "2011-11-17T21:35:39Z"
tags: []
categories: ["行业应用"]
slug: "webtable-click-link"
draft: false
lastmod: "2011-11-17T21:43:46Z"
id: 1264884
url: "https://jerome-wang.iteye.com/blog/1264884"
---

只写个函数 相信会vbs代码的人都能看懂

 

Function JreportLinkClick(BrowserName,PageName,FrameName,WebTableName,LinkName)

   Dim oDesc,LinkNumber  
   Set oDesc = Description.Create()  
   oDesc("micclass").Value = "Link"  
   Set Lists = Browser(BrowserName).Page(PageName).Frame(FrameName).WebTable(WebTableName).ChildObjects(oDesc)  
   LinkNumber = Lists.Count()  
   For i = 0 to LinkNumber-1  
       If Lists(i).GetRoProperty("innertext") = LinkName Then  
           Lists(i).Click  
       End If

   Next  
    
End Function