I have word document, open that word document in maximize screen directly when i using word 13/16 but problem on word 10/365 it has open but goes to task bar using VB.Net,
Please provide me solution....
What I have tried:
- Dim WordApp As New Microsoft.Office.Interop.Word.Application
- Dim DocToOpen As Microsoft.Office.Interop.Word.Document
- DocToOpen = WordApp.Documents.Open(CStr(szDisplayFile))
- WordApp.WindowState = Word.WdWindowState.wdWindowStateMaximize
- WordApp.ActiveWindow.ActivePane.View.Zoom.Percentage = 100
- WordApp.Visible = True
- ActivateDocumentWindow(szDisplayFile)
- WordApp.Activate()
- Application.DoEvents()
-
- Public Sub ActivateDocumentWindow(ByVal a_strDocName As String)
- Dim Alllocal As Process() = Process.GetProcesses()
- Dim Item As Process
-
- For Each Item In Alllocal
-
- If Item.MainWindowTitle.ToString <> "" Then
- If InStr(Item.MainWindowTitle.ToString, a_strDocName) > 0 Then
- Dim intOurDoc As Integer = Item.Id
- AppActivate(intOurDoc)
- Exit For
- End If
- End If
- Next
- End Sub