Hi Guy's I'm really struggling with this one, My Outllook Template is saved into 'Documents folder' when Outlook is running everything is fine when I click the commoand button to open the email 'Template' on my form in Access.
Now if Outlook is closed and I click the button I get an error message saying that the that Access can't open the 'Template' it's possible thet file maybe open ect.
I need this to open on any desktop/user.
I have asked before and have done endless searches to try and sovle the issue but to no avial and it's paramount that I get the issue solved for the company. the code belowe as follows. I really hope you can help (And thanks to all those that have tried previously).



The code in red is the problem when Outlook is not running. :banghead::banghead::banghead:
Now if Outlook is closed and I click the button I get an error message saying that the that Access can't open the 'Template' it's possible thet file maybe open ect.
I need this to open on any desktop/user.
I have asked before and have done endless searches to try and sovle the issue but to no avial and it's paramount that I get the issue solved for the company. the code belowe as follows. I really hope you can help (And thanks to all those that have tried previously).




The code in red is the problem when Outlook is not running. :banghead::banghead::banghead:
Dim myOlApp As Outlook.Application
Dim myitem As Outlook.MailItem
Dim n As Integer
Dim sUsername As String
Dim filesPath As String
Set myOlApp = CreateObject("Outlook.Application")
Set myitem = myOlApp.CreateItemFromTemplate("Template.msg")
sUsername = Environ$("username")
filesPath = Environ$("USERPROFILE")
With myitem
For n = 0 To Me.EmailList.ListCount - 1
.Attachments.Add (Me.EmailList.ItemData)
Next n
myitem.Subject = Nz("")
myitem.To = Nz(Me.txtCustomerEmailAddress1)
myitem.Display
End With