Forum Discussion
Jill_Marlow
Jan 18, 2022Copper Contributor
Create Outlook meeting from Access VBA
I am the treasurer at a United Methodist Church (UMC). I would like to create an Outlook meeting based on input from an Access database form. The catch is that I would like the organizer of the mee...
MariaBarnes
Jan 18, 2022MVP
Jill, I think you are very close. Instead of calling Application.CreateItem, create the item directly using oFolder.Items.Add
So instead of
Set myMeeting = myOutlook.CreateItem(olAppointmentItem)
try
Set myMeeting = oFolder.Items.Add(olAppointmentItem)
So instead of
Set myMeeting = myOutlook.CreateItem(olAppointmentItem)
try
Set myMeeting = oFolder.Items.Add(olAppointmentItem)
- Jill_MarlowJan 18, 2022Copper Contributor
That worked! Thanks so much. I created a test event and it put it on UMC Event's calendar and not mine. The only glitch is, and this happened originally, is that the room is on the meeting twice. I'll have to look at the code more closely to see if the room is somehow being invited twice. Thanks again! MariaBarnes
- Jill_MarlowJan 18, 2022Copper ContributorI just figured it out. I had both .resources and .location which were set to the name of the room chosen in the form. I didn't need both, so I deleted the line with .location.
- Jill_MarlowJul 22, 2022Copper Contributor
As I said in my previous reply, the test I created was successful. I hadn't used the code since then. I tried another test because I added another criterion. Now when I run the code, it puts the meeting on the UMC Events calendar, but on the line .Send to send the invitation to the invitees and the resources, I get the following error:
Here is the code that is scheduling the meeting:
With myMeeting
.Resources = strLocation
.MeetingStatus = olMeeting
.RequiredAttendees = strInvitees
.Subject = strSubject
.Start = dteStartDate + dteStartTime
.End = dteEndDate + dteEndTime
.ReminderMinutesBeforeStart = 15
For Each oAccount In Accounts
If oAccount.DisplayName = "email address removed for privacy reasons" Then
.SendUsingAccount = oAccount
.Save
.Send
End If
Next
End WithI restarted Outlook as the error message suggested, but I still get the same error. Since I last used this code, I got a new computer which is running Windows 11 if that makes a difference. Does anyone know how to resolve this issue? Thanks.
Jill