VBA关闭在IE中打开的WORD?
把下面代码中的“网页标题”改为你要关闭的IE的标题,然后运行,即可关闭在IE中打开的WORD:
Dim oShellApp, oShellAppWindows, oWin Set oShellApp = CreateObject("Shell.Application"
) Set oShellAppWindows = oShellApp.Windows For Each oWin In oShellAppWindows If LCase(TypeName(oWin.document)) = "htmldocument" Then If InStr(1, oWin.locationname, "网页标题", vbTextCompare) > 0 Then oWin.Navigate "about:blank" Exit For End If End If Next Set oWin = Nothing Set oShellApp = Nothing Set oShellAppWindows = Nothing
Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有 粤ICP备16019765号
广州京杭网络科技有限公司 版权所有