问题
The internet explorer on my side is set to Auto-Select in Encoding from VIew menu. I would like to change the encoding to UTF-8 by VBA code .. I tried such a line but seems not to work as expected
ie.document.Charset = "utf-8"
Any idea how to achieve that?
回答1:
you can try this code
Sub IEGetToKnow()
Dim IE As InternetExplorer
Set IE = New InternetExplorer
With IE
.Visible = True
.Navigate2 "http://www.google.com.eg"
While .Busy Or .readyState <> READYSTATE_COMPLETE:DoEvents:Wend
.Document.Charset = "utf-8"
.Refresh
End With
End Sub
来源:https://stackoverflow.com/questions/62365659/change-internet-explorer-encoding-using-vba