[表示色を変更する]
背景色,文字色,リンク色を変更します。
【ソースコード】
[tips0163.vbs]
Option Explicit
On Error Resume Next
Dim strUrl
Dim objIE
Dim objDoc
Dim objStyle
Dim strBgColor
Dim strFgColor
Dim strLinkColor
strUrl = "http://www.whitire.com/"
strBgColor = "#000000"
strFgColor = "#ff0000"
strLinkColor = "#00ff00"
Set objIE = WScript.CreateObject("InternetExplorer.Application")
If Err.Number = 0 Then
objIE.Navigate strUrl
objIE.Visible = True
Do While objIE.busy
WScript.Sleep(100)
Loop
Do While objIE.Document.readyState <> "complete"
WScript.Sleep(100)
Loop
Set objDoc = objIE.Document
objDoc.bgColor = strBgColor
objDoc.fgColor = strFgColor
objDoc.linkColor = strLinkColor
Set objStyle = objDoc.Body.Style
objStyle.backgroundColor = strBgColor
objStyle.Color = strFgColor
objDoc.LinkColor = strLinkColor
Else
WScript.Echo "エラー:" & Err.Description
End If
Set objIE = Nothing