PaulBarter
MIS
I have a VB6 prog that creates a new word document. Then I want the Word doc to be on top for the user to use.
I can easily create the document, but am not sure how to get Word on top. I'm sure it's very easy and has been covered before, but I'm not sure what to search the forum for!
Sample code:
How do I then get the Word window on top
I can easily create the document, but am not sure how to get Word on top. I'm sure it's very easy and has been covered before, but I'm not sure what to search the forum for!
Sample code:
Code:
Private Sub Command1_Click()
Dim appWord As Word.Application
Dim docWord As Word.Document
On Error Resume Next
Set appWord = GetObject(, "Word.Application") ' find Word if open
On Error GoTo 0
If Err Then
Set appWord = CreateObject("Word.Application") ' if not then open it
End If
appWord.Visible = True
Set docWord = New Word.Document ' start new document
Debug.Print "Created;"; docWord.Name
' make the document
docWord.Content.InsertAfter Text:="Here is your document."
'etc
'etc
Set docWord = Nothing
Set appWord = Nothing
End Sub
How do I then get the Word window on top