VB calls WebBrowser skills set 1

zhaozj2021-02-16  83

1. Get your browser information:

Private submmand1_click () webbrowser1.navigate "http://www.applevb.com" End Sub

Private Sub Command2_Click () Dim oWindow Dim oNav Set oWindow = WebBrowser1.Document.parentWindow Set oNav = oWindow.navigator Debug.Print oNav.userAgent Set oWindow = Nothing Set oNav = NothingEnd Sub

Click the Command1 to browse the web, click Command2 to output browser information in the immediate window.

2, pop up the webbrowser message window

Dim Owindow Set Owindow = WebBrowser1.document.parentWindow Owindow.confirm "ABCD"

转载请注明原文地址:https://www.9cbs.com/read-12213.html

New Post(0)