Search for specific Outlook contact card and email members (1 Viewer)

sherlocked

Registered User.
Local time
Today, 02:19
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
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 09:19
Joined
Jul 9, 2003
Messages
16,245
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.
 

Gasman

Enthusiastic Amateur
Local time
Today, 09:19
Joined
Sep 21, 2011
Messages
14,050
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

Top Bottom