I have the following code working on my XP machine.
When I changed to Vista the code stopped working. I ran the debug and have not received any errors... Im totally at a loss here.
Code:
Private Sub Command25_Click()
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = Nz(DLookup("Contact_Information_Email", "Inspection", "[requests_InspectionID]=" & Me!requests_InspectionID)) & ";" & Nz(DLookup("Agent_Email", "Inspection", "[requests_InspectionID]=" & Me!requests_InspectionID)) & ";" & Nz(DLookup("Listing_Agent_Email", "Inspection", "[requests_InspectionID]=" & Me!requests_InspectionID))
.Subject = "Your inspection has been scheduled."
.Body = "Greetings " & Format(DLookup("Contact_Information_FirstName", "Inspection", "[requests_InspectionID]=" & Chr(34) & Me!requests_InspectionID & Chr(34)), " ") & " " & Format(DLookup("Contact_Information_LastName", "Inspection", "[requests_InspectionID]=" & Chr(34) & Me!requests_InspectionID & Chr(34)), "") & " your inspection has been scheduled for " & Format(DLookup("InspectionDate", "Inspection", "[InspectionID]=" & Me!Inspection_InspectionID), "mmmm d, yyyy") & " at " & Format(DLookup("InspectionTime", "Inspection", "[InspectionID]=" & Me!Inspection_InspectionID), " hh:mm AMPM ") & " at the following address; " & Nz(DLookup("SiteAddress", "Inspection", "[SiteAddress]=" & Chr(34) & Me!SiteAddress & Chr(34)), "") & ". If you have any questions or concerns please feel free to contact us." & vbCrLf & vbCrLf & "Thank you," & vbCrLf & "Kurt Nelson" & vbCrLf & "Winding River Home Inspection Services LLC." & vbCrLf & "970-222-2104 or 303-774-1104"
.Display
End With
'MsgBox MailOutLook.Body
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
Resume Error_out
Error_out:
End Sub
When I changed to Vista the code stopped working. I ran the debug and have not received any errors... Im totally at a loss here.