Search for specific Outlook contact card and email members

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! :)

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
 
I noticed that you have yet to receive a reply. Hence I'm bumping your post of the list, so it gets another look, and maybe someone will come back with an answer.
 
I add recipients as follows

Code:
    Dim objOutlookRecip As Outlook.Recipient
.
.
    Set objOutlookRecip = .Recipients.Add("Jim Needs - Personal")
    objOutlookRecip.Type = olTo

HTH
 

Users who are viewing this thread

Back
Top Bottom