使用VBA更改Internet Explorer编码 [英] Change Internet Explorer encoding using VBA

查看:64
本文介绍了使用VBA更改Internet Explorer编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我这一边的Internet Explorer在从菜单中的编码"菜单中设置为自动选择".我想通过VBA代码将编码更改为UTF-8.我尝试过这样的线路,但似乎无法按预期工作

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"

有什么想法要实现吗?

推荐答案

您可以尝试此代码

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

这篇关于使用VBA更改Internet Explorer编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆