ckennerdale
Programmer
I have some code which generates an email. As it is using DoCmd.SendObject I thought it just fired up your default email client, and didnt need to load up any module or library.
It works fine on my Outlook 2000, but when trying on a colleagues Office 98 (it needs to run on both machines) i get the following message
"Cant find priject or library"
here is my code
Private Sub Send_Email_Button_Click()
' Prevent error screen if user cancels without sending mail.
On Error Resume Next
Dim strToWhom As String '<---sets up a variable object for who we are going to send out email to
Dim strMsgTitle As String '<---sets up a variable object for the title of the email
Dim strMsgBody As String '<---sets up a variable object for the body of our email
strToWhom = Me!Email
strMsgTitle = "Job Number IR" & Me!ID & " " & Me!JobName
strMsgBody = "Dear " & Me!Name & Chr(13)
strMsgBody = strMsgBody & "Re Job Number IR" & Me!ID & Chr(13)
strMsgBody = strMsgBody & Me!JobName & Chr(13) & Chr(13)
strMsgBody = strMsgBody & "Please find attached the appropriate files." & Chr(13) & Chr(13)
strMsgBody = strMsgBody & "If you have an questions please do not hesitate to contact me." & Chr(13) & Chr(13)
strMsgBody = strMsgBody & "Thanks" & Chr(13)
strMsgBody = strMsgBody & "Corporate Policy Team"
' Provide Subject title bar and message text.
DoCmd.SendObject , , , strToWhom, , , strMsgTitle, strMsgBody, True
End Sub
Thanks in advance
Caspar Kennerdale
It works fine on my Outlook 2000, but when trying on a colleagues Office 98 (it needs to run on both machines) i get the following message
"Cant find priject or library"
here is my code
Private Sub Send_Email_Button_Click()
' Prevent error screen if user cancels without sending mail.
On Error Resume Next
Dim strToWhom As String '<---sets up a variable object for who we are going to send out email to
Dim strMsgTitle As String '<---sets up a variable object for the title of the email
Dim strMsgBody As String '<---sets up a variable object for the body of our email
strToWhom = Me!Email
strMsgTitle = "Job Number IR" & Me!ID & " " & Me!JobName
strMsgBody = "Dear " & Me!Name & Chr(13)
strMsgBody = strMsgBody & "Re Job Number IR" & Me!ID & Chr(13)
strMsgBody = strMsgBody & Me!JobName & Chr(13) & Chr(13)
strMsgBody = strMsgBody & "Please find attached the appropriate files." & Chr(13) & Chr(13)
strMsgBody = strMsgBody & "If you have an questions please do not hesitate to contact me." & Chr(13) & Chr(13)
strMsgBody = strMsgBody & "Thanks" & Chr(13)
strMsgBody = strMsgBody & "Corporate Policy Team"
' Provide Subject title bar and message text.
DoCmd.SendObject , , , strToWhom, , , strMsgTitle, strMsgBody, True
End Sub
Thanks in advance
Caspar Kennerdale