jamierbooth
Registered User.
- Local time
- Today, 15:17
- Joined
- Oct 23, 2013
- Messages
- 36
Hi All, I'm trying to have a command button send info on the form straight to Outlook as a meeting. So far, the code below works apart from the address bit. I need the code to automatically add the same 2 email addresses as recepients everytime.
Error message highlights the red line below with the following message:
Runtime error '438'
Object doesn't support this property or method
I'm new to VBA, so don't understand what is wrong here. The reference is set, I've tried different permutations of the "To:" & "Recipients.Add" for the email address with no joy.
Any help would be grand!
Cheers, Jamie.
Error message highlights the red line below with the following message:
Runtime error '438'
Object doesn't support this property or method
I'm new to VBA, so don't understand what is wrong here. The reference is set, I've tried different permutations of the "To:" & "Recipients.Add" for the email address with no joy.
Any help would be grand!
Cheers, Jamie.
Code:
Private Sub cmdSend_Click()
Dim outApp As Object
Set outApp = CreateObject("Outlook.application")
Set outmail = outApp.CreateItem(olappointmentitem)
outmail.MeetingStatus = olMeeting
[COLOR=red]outmail.To = "[/COLOR][COLOR=red]emailaddress1@mail.com;emailaddress2@mail.com[/COLOR][COLOR=red]"[/COLOR]
outmail.Start = Me!ApptDate & " " & Me!ApptTime
outmail.Duration = 60
outmail.Subject = Me!txtFirstname.Value & " " & Me!txtSurname.Value
outmail.Body = "To see" & " " & Me!txtToSee.Value
outmail.display
Set outmail = Nothing
Set outApp = Nothing
End Sub
Last edited: