2013-05-27 201 views
1

如何以全屏模式打開Word文檔?它不是在形式打開,它就會打開用下面的代碼:打開Word文檔全屏

Private MSWord As New Word.Application 
Private WordDoc As New Word.Document 

Private Sub OpenWordFullScreen(ByVal ReportName As String) 
    MSWord = New Word.Application 

    WordDoc = MSWord.Documents.Open("C:\" & ReportName & ".doc") 

    'Make MSWord visible 
    MSWord.WindowState = Word.WdWindowState.wdWindowStateMaximize 
    MSWord.Visible = True 
End Sub 

回答

2

要在全屏模式打開word,添加以下代碼片段:

WordDoc.ActiveWindow.View.FullScreen = True 

所以,你的代碼看起來像這樣:

Private Sub OpenWordFullScreen(ByVal ReportName As String) 
    MSWord = New Word.Application 

    WordDoc = MSWord.Documents.Open("C:\" & ReportName & ".doc") 

    'Make MSWord Visible 
    MSWord.Visible = True 
    WordDoc.ActiveWindow.View.FullScreen = True 
End Sub