UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Send Appointment To Multiple Recipients From Access Query In Vba, Office 2013    
 
   
gelderr
post Mar 27 2020, 05:53 AM
Post#1



Posts: 4
Joined: 13-March 20



Hi all,

Does anyone know how to send an outlook appointment to multiple recipients from access query?
Below the simple vba code I currently use for one recipient (pretty new to this all)
The query I created only returns the email addresses of certain people within the company.

Query
CODE
SELECT Contactpersonen.Bedrijf, Contactpersonen.Categorie, Contactpersonen.[E-mailadres]
FROM Contactpersonen
WHERE (((Contactpersonen.Bedrijf) Like "COMPANY*" Or (Contactpersonen.Bedrijf) Like "Company*") AND ((Contactpersonen.Categorie)="Intern"));


VBA code
CODE
Option Compare Database

Private Sub CmdCreateAppointment_Click()

' Save record first to be sure required fields are filled.
DoCmd.RunCommand acCmdSaveRecord

Dim objOutlook          As Outlook.Application
Dim outMail             As Outlook.AppointmentItem
Dim myRequiredAttendee  As Outlook.recipient

Set outMail = Outlook.CreateItem(olAppointmentItem)

outMail.Subject = "Oplevering 1ste concept rapportage" & "; " & Forms![Projectgegevens]![Project Name]

outMail.Start = Me!OpleverDatumConcept1 & Space(1) & "11:00"
outMail.End = Me!OpleverDatumConcept1 & Space(1) & "12:00"
outMail.BusyStatus = olFree

outMail.MeetingStatus = olMeeting
Set myRequiredAttendee = outMail.Recipients.Add("test@test.com")  "I would like to have my query here"
    myRequiredAttendee.Type = olRequired

outMail.Display

End Sub


Thanks in advance
Go to the top of the page
 

Posts in this topic



Custom Search


RSSSearch   Top   Lo-Fi    5th July 2020 - 09:35 PM