如何用vb使浏览器中的链接颜色变成已点击的那种

来源:百度知道 编辑:UC知道 时间:2024/06/06 20:38:14
想写一个程序,当这个程序运行后,浏览器打开的所有页面内的连接都变成了已点击的那样,如图:
前提是:不要让程序自动点击连接,浏览器也不是放在vb程序中的。
有能帮忙的吗?
3楼你好,我试了你的代码可是为什么没变色呢?

'请先打开IE,再运行下面代码。经调试,成功运行。

Private Sub Command1_Click()
Dim link
Dim mColor As String
On Error Resume Next
mColor = CreateObject("Wscript.Shell").RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Settings\Anchor Color Visited")
Dim oShellApp, oShellAppWindows, oWin
Set oShellApp = CreateObject("Shell.Application")
Set oShellAppWindows = oShellApp.Windows
For Each oWin In oShellAppWindows
If LCase(TypeName(oWin.Document)) = "htmldocument" Then
Set webdoc = oWin.Document
For Each link In webdoc.links
link.Style.Color = "RGB(" & mColor & ")"
Next
End If

Next
Set link = Nothing
Set oWin = Nothing
Set oShellApp = Nothing
Set oShellAppWindows = Nothing
msgbox "链接