sherlocked
Registered User.
- Local time
- Today, 01:22
- Joined
- Sep 22, 2014
- Messages
- 125
Hi experts,
I'm working on a function to generate an outlook calendar invite from a form in my database. The person generating the email will need to be able to enter a specific contact card name and the invite should go to everyone on the card.
I have worked up the below but it hits an error when I try to pass the value of the input box to the Outlook folder item. Any ideas on where I am going wrong?
As always thanks in advance for any assistance you can provide!
I'm working on a function to generate an outlook calendar invite from a form in my database. The person generating the email will need to be able to enter a specific contact card name and the invite should go to everyone on the card.
I have worked up the below but it hits an error when I try to pass the value of the input box to the Outlook folder item. Any ideas on where I am going wrong?
As always thanks in advance for any assistance you can provide!
Code:
Private Sub OutlookInvite()
Dim obj0App As Object
Dim objAppt As Object
Dim List As DistListItem, F As Folder
Dim Recipients As String
Set obj0App = CreateObject("Outlook.Application")
Set objAppt = obj0App.CreateItem(1) 'olAppointmentItem
Set F = Session.GetDefaultFolder(olFolderContacts)
F.ShowAsOutlookAB = True
Recipients = InputBox("Please Enter Contact Card Name", "Distro List?", "", 100, 100)
Set List = F.Items("Recipients")
With objAppt
.RequiredAttendees = List
.Subject = "Meeting spaces booked for " & Me.txtTest & ""
.Importance = 2 'high
.ReminderMinutesBeforeStart = 15 'reminder set for 15 minutes before the event
.Body = "You have been scheduled for " & Me.txtTest & "."
.MeetingStatus = 1
.ResponseRequested = True
.Save
.Display
End With