如何以编程方式从 MS Access 最大化浏览器?
我最大化浏览器的目的是为用户提供从 MS Access 应用程序到 Web 应用程序的连接和无缝体验。出于这个原因,我正在寻找一种解决方案,最大限度地提高通过 MS Access 应用程序控制的 Web 浏览器的相同实例。
我首先做这样的事情:
Dim IE As InternetExplorer
Set IE = New InternetExplorer
IE.Navigate2 "\\File Location\index.html"
IE.Document.all("txtSearchKey").innertext = SearchKeyValue
IE.Document.all("btnSearchForKey").Click
IE.Visible = True
Set IE = Nothing
但我想做的是确保每次运行此代码时,浏览器也最大化。
以编程方式完成此任务的最佳方法是什么?
My purpose for maximizing the browser is to provide a connected and seamless experience for the user from their MS Access application to their web application. For this reason I am looking for a solution which maximizes the same instence of the web browser being controlled via the MS Access application.
I start by doing something like this:
Dim IE As InternetExplorer
Set IE = New InternetExplorer
IE.Navigate2 "\\File Location\index.html"
IE.Document.all("txtSearchKey").innertext = SearchKeyValue
IE.Document.all("btnSearchForKey").Click
IE.Visible = True
Set IE = Nothing
But what I want to do is ensure every time this code is run, the browser is also maximized.
What is the best way to accomplish this programmatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现以下 Windows API 调用对于设置 Web 浏览器的窗口大小特别有用。这看起来也可以与窗口句柄可用的任何其他窗口应用程序一起使用。
因此,通过将其放在上面问题中的代码末尾,我调用了此函数来将浏览器大小设置为最大化:
I found the following windows API call to be particularly useful in setting the window size of the web browser. This looks like it could also be used with any other windows application for which the window handle is available to as well.
So, by putting this together at the end of the code in the question above, I made this function call to set the browser size to maximized:
如果使用
Shell
语句调用浏览器,则可以使用vbMaximizedFocus
窗口样式。 Windows 资源管理器示例:If you call the browser using the
Shell
statement, you can use thevbMaximizedFocus
windowstyle. Example with Windows Explorer: