Change Internet Explorer encoding using VBA

荒凉一梦 提交于 2020-06-16 17:01:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!