简体   繁体   English

在Internet Explorer中强制打开本地html文件的方法

[英]Ways to force open local html file in internet explorer

How do i force open an html file saved on desktop to open in internet explorer assuming the default browser is chrome. 假设默认浏览器是chrome,如何强制打开保存在桌面上的html文件以在Internet Explorer中打开。

Or if it is possible to make ms word hyperlink open website links in internet explorer will also be acceptable. 或者,如果可以使ms字超链接在Internet Explorer中打开网站链接,也可以接受。

thx 谢谢

You would need something like a shell script to open the Internet Explorer executable. 您将需要诸如Shell脚本之类的东西来打开Internet Explorer可执行文件。 The OS will automatically open the default browser from any hyperlink, so it won't be possible to do with a simple hyperlink from within Microsoft Word. 操作系统将自动从任何超链接打开默认浏览器,因此无法从Microsoft Word中使用简单的超链接来进行操作。 However, you could probably use VBA to do so. 但是,您可能可以使用VBA这样做。 Here's an example of opening a file with Internet Explorer from VBA: How to code vba to open internet explorer in new session? 这是从VBA使用Internet Explorer打开文件的示例: 如何在新会话中对vba进行编码以打开Internet Explorer? .

You can do it on CMD or copy this in a test.bat 您可以在CMD上执行此操作,也可以将其复制到test.bat中

"C:\Program Files\Internet Explorer\iexplore.exe" D:\frogger\index.html`

If you want to call IE from word, just create a Hyperlink with 如果要通过单词调用IE,只需使用以下命令创建一个超链接

C:\Program Files\Internet Explorer\iexplore.exe

But I don't know any way to open with this a specific file in IE. 但是我不知道有什么方法可以在IE中打开此特定文件。


EDIT: 编辑:
If you want to do this on your local PC you could do it like this: 如果要在本地PC上执行此操作,则可以这样操作:

  1. Create a test.bat like shown above. 如上所示创建一个test.bat。
  2. Create a Hyperlink into your word-Document to your test.bat 在您的word文档中创建一个超链接到test.bat

With this you should open your HTML-file in IE started from Word. 与此相关,您应该在从Word开始的IE中打开HTML文件。
If you want to to this in your network it should work too if you use a networkpath for your test.bat 如果您想在网络中做到这一点,如果您将网络路径用于test.bat,它也应该工作

You can right click on the HTML file . 您可以右键单击HTML文件。 Select properties and then change it to internet explorer or ms word as u wish. 选择属性,然后根据需要将其更改为Internet Explorer或ms word。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM