Forum Discussion

official_raghu's avatar
Occasional Contributor
11 years ago

Setting MS Word Visible

I am trying to open Microsoft Word application in automation.

Sub OpenWordDoc

  Dim objWord, objWordDoc

  Set objWord = Sys.OleObjects("Word.Application")

  Set objWordDoc = objWord.Documents.Open(C:/ProgramFiles/.../.xyz.docx)

  objWord.Visibe = True

End Sub

This of course creates an instance of WINWORD.EXE and opens the xyz.docx file, but it doesn't become maximized (visible on screen). It just sticks to the task bar. I tried many things, like:

objWord.Application.Visible = True


objWord.WindowState = 1

objWordDoc.ActiveWindow.Visible = True


objWordDoc.ActiveWindow.Panes(1).Visible = True

and so on... None seem to work.. Please help. All thanks in advance :)

4 Replies

  • vajindarladdad's avatar
    Frequent Contributor
    Hi Raghu,

    Please try the following code

    Dim objWord , objDoc

    Set objWord = CreateObject("Word.Application")

    Set objDoc = objWord.Documents.Open("c:\Test.doc")

    objWord.Visible = True

    I hope this has been of some help.
  • Ravik's avatar
    Super Contributor
    Hi Raghu,  Please refer below code it will be Open MS Word and make it visible on Desktop

    Sub TestWord

    Set objWord = CreateObject("Word.Application")

    Set objWordDoc = objWord.Documents.Open("Path of Your File")

    objWord.Application.visible = true

    End Sub

    it will be help you