2015-10-05 225 views
1

我的默認瀏覽器設置爲Firefox,但是我想在IE(全屏)中的幻燈片放映幻燈片中打開超鏈接。 我用下面的宏:如何在全屏瀏覽器中啓動Powerpoint演示文稿?

Sub hyperlink() 
sCmd = """C:\Program Files\Internet Explorer\iexplore.exe"" " _ 
& "http://www.google.com/" 
Shell sCmd 
End Sub 

當我點擊超鏈接它會打開IE瀏覽器中的網站,但在背景上。我仍然必須退出Powerpoint。是否有可能在全屏模式下立即打開鏈接?

回答

1

可以試試Internet Explorer的kiosk模式與-k開關

然而PowerPoint將仍然是開放的,退出你需要使用Alt-F4 kiosk模式

此代碼也應該把IE的前景

Public Declare PtrSafe Function FindWindow% Lib "user32" Alias "FindWindowA" _ 
              (ByVal lpclassname As Any, _ 
              ByVal lpCaption As Any) 

Public Declare PtrSafe Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ 
           ByVal hWndInsertAfter As Long, _ 
           ByVal X As Long, _ 
           ByVal y As Long, _ 
           ByVal cx As Long, _ 
           ByVal cy As Long, _ 
           ByVal wFlags As Long) As Long 

Global Const HWND_TOPMOST = -1 
Global Const SWP_NOSIZE = &H1 
Global Const SWP_NOMOVE = &H2 

Sub hyperlink() 
sCmd = """C:\Program Files\Internet Explorer\iexplore.exe"" -k " _ 
& "http://www.google.com/" 
Shell sCmd 
hwnd% = FindWindow%("Internet Explorer", 0&) 
Call SetWindowPos(hwnd%, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or _ 
     SWP_NOSIZE) 
End Sub 

測試在Win 10的x64和PowerPoint 2013 & IE11

相關問題