Hello,
Using this code I found elsewhere to open up a word document using a button on a form:
Private Sub ButtonAK_Click()
Dim APDKey As String
Dim App As Object
APDKey = "C:\Desktop\AK\2014.doc"
If Dir(APDKey) = "" Then
MsgBox "Document not found."
Else
Set App = CreateObject(Class:="Word.Application")
App.Visible = True
App.Documents.Open FileName:=APDKey
End If
End Sub
The word document does open, but my small problem is it opens in the background. The document is a info guide so I would like word to open in front of the form for ease of reading (have priority or however it is phrased). Is there code to do this?
Using this code I found elsewhere to open up a word document using a button on a form:
Private Sub ButtonAK_Click()
Dim APDKey As String
Dim App As Object
APDKey = "C:\Desktop\AK\2014.doc"
If Dir(APDKey) = "" Then
MsgBox "Document not found."
Else
Set App = CreateObject(Class:="Word.Application")
App.Visible = True
App.Documents.Open FileName:=APDKey
End If
End Sub
The word document does open, but my small problem is it opens in the background. The document is a info guide so I would like word to open in front of the form for ease of reading (have priority or however it is phrased). Is there code to do this?