Making Word the active window (1 Viewer)

Peter Bellamy

Registered User.
Local time
Today, 15:29
Joined
Dec 3, 2005
Messages
295
I have some code on the click of a button of a form which checks for the existence of a word document and if it is there starts word and opens the document.

Code:
imagerecno = Trim(Str(return_no))
strDocName = imagerecno & ".doc"
FullPath = "Z:\Database\2000\Returns\Docs\" & strDocName

'Check folder contains a doc, open info window if not, doc if it does
With CodeContextObject
'Debug.Print FullPath
    If Dir([FullPath]) <> Empty Then
        Set objApp = CreateObject("Word.Application")
        objApp.Visible = True
        objApp.Documents.Open FullPath
    Else
       ' open form with info message
    End If
End With

Everything works but the Word window is not made the active window at the front.

How can I do that?

Cheers
 

Peter Bellamy

Registered User.
Local time
Today, 15:29
Joined
Dec 3, 2005
Messages
295
Brilliant, thanks!
 

Users who are viewing this thread

Top Bottom