I have the following code:
It does a fine job of opening the document, but it is minimized, and I need to click on it to have it displayed on the screen. I would like to have it opened, and displayed on the screen, not minimized in the task bar. What am I doing wrong?
Code:
Private Sub Command3_Click()
Dim oWord As Word.Application
Dim oDoc As Word.Document
Set oWord = GetObject(, "Word.Application")
If oWord Is Nothing Then
Set oWord = CreateObject("Word.Application")
End If
oWord.Documents.Open FileName:="c:\labor.doc"
oWord.Documents("labor.doc").Activate
Set oDoc = oWord.ActiveDocument
oWord.Visible = True
End Sub