Hi EE
Still having trouble opening word in access 2013. I have the following
Dim db As DAO.Database, rs As DAO.Recordset
Dim search
Set db = CurrentDb
search = "SELECT * FROM tblConfig WHERE [ConfigID] = " & 1
Set rs = db.OpenRecordset(search)
DocLocation = rs.Fields("DocumentLocation")
OrgID = Me!txtOrgID
Organisation = Me!txtOrgname
DocFileName = "HO" & OrgID & Organisation & ".docx"
If Right(DocLocation, 1) = "\" Then
path = DocLocation & DocFileName
Else
path = DocLocation & "\" & DocFileName
End If
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
If Dir(path) <> "" Then
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
wrdApp.Activate
Set wrdDoc = wrdApp.Documents.Open(path)
wrdDoc.Application.WindowState = wdWindowStateMaximize
wrdDoc.Activate
Else
MsgBox ("There is no Document for this project"), vbOKOnly, "Message"
End If
At the moment wdWindowsState is maximised, I have tried Normal When I run word opens in the background (Underneath the opening form)
Before I introduced the line wdWindowsState word would open minimised. I just want word to allways open over the access form. I have made form Popup and model = no. If I transfer the code and run access 2003 there is no problems. Any help appreciated
chestera
Thank you Ryan I will give it a try and get back to you. I will be away from PC for a while
Alan