vb6 microsoft html object library,How to type cast webbrowsercontrolobj.document to mshtml.HTMLDocum...

Hello I am writing code in VB6 only (no VB.NET)

I have webbrowsercontrol object named webbrowser1

I have added reference of microsoft html object library in project.

I am trying this line but is giving error.

Dim doc as MSHTML.HTMLDocument

doc = DirectCast(webbrowser1.document, MSHTML.HTMLDocument)

line 2 is giving error that no method or data found at MSHTML.HTMLDocument

Please help me solving this problem.

What I want is I have one webpage having 2 (html forms) in it. I am loading that page into

webbrowser control by,

webbrowser1.navigate "url"

I have mapped event to handle html button click in webbrowser1's document.

When user clicks on this button I want to submit second form of html page.

Is there any other way to do it?

I also tried following code

'this line is working properly

'this is the code to submit first form in html page

webbrowser1.document.Forms(0).submit

but when I do

'this line is giving error though there are 2 forms available in html page

webbrowser1.document.Forms(1).submit

So ultimate goal is to submit second form of html document.

Please show me right direction.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值