chestera
asked on
Open word in access 2013
Hi EE I have the following
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Dim filepath As String
If Dir(Path) <> "" Then
Set wrdApp = CreateObject("Word.Applica tion")
wrdApp.Visible = True
wrdApp.Activate
filepath = Path
Set wrdDoc = wrdApp.Documents.Open(file path)
Else
MsgBox ("There is no Document for this project"), vbOKOnly, "Message"
End If
In access 2003 the document opens. I have migrated to access 2013 there is a minor irritant it opens minimized. I have to select the word icon on the desktop for it to open. any help appreciated
chestera
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Dim filepath As String
If Dir(Path) <> "" Then
Set wrdApp = CreateObject("Word.Applica
wrdApp.Visible = True
wrdApp.Activate
filepath = Path
Set wrdDoc = wrdApp.Documents.Open(file
Else
MsgBox ("There is no Document for this project"), vbOKOnly, "Message"
End If
In access 2003 the document opens. I have migrated to access 2013 there is a minor irritant it opens minimized. I have to select the word icon on the desktop for it to open. any help appreciated
chestera
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It should be like this....
Dim wrdApp As Object
Dim wrdDoc As Object
Dim filepath As String
filepath = Environ("UserProfile") & "\Desktop\MyWordDocument.docx" 'Replace the filepath as per your requirement
If Dir(filepath) <> "" Then
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
wrdApp.Activate
Set wrdDoc = wrdApp.Documents.Open(filepath)
Else
MsgBox ("There is no Document for this project"), vbOKOnly, "Message"
End If
The above code will open a word document MyWordDocument.docx saved on your desktop
ASKER
Thanks again Ryan it's fixed
ASKER
sktneer
Thank you
Alan
Thank you
Alan
You're welcome Alan!
pls try
Open in new window
Regards