?
Solved

use VBA to send appointment or meeting request, but I don't want to attend

Posted on 2011-09-29
4
Medium Priority
?
1,508 Views
Last Modified: 2012-05-12
I've got an Access VBA application that I want to create appointments from. I've used FreeBusy information to figure out when someone's available, now I need to send them an email notifying them that I've booked them. Plus I want to book the room at the same time.

This seems to work with the following VBA code. Except that I'm included in the meeting, and I don't want to be. So how can I do this?

I know how to scroll through a list of Mailboxes, find the right Mailbox, then add the Appointment Item to that folder (instead of my default Appointment folder). But I'd like to have a way of doing this without requiring everyone who uses the application to open every possible recipient's Mailbox.

Since I have 23 possible recipients + 6 meeting rooms, I thought maybe another way to do it would be to send the appointment request on behalf of the meeting room, then add the other person to the recipients list. That would only require having the 6 meeting rooms open from the user's Outlook. But still, I wonder if there's a way to do this without requiring that any of these other Mailboxes are open.

I thought there should be a way to remove me from the Recipients collection, but I'm not in the collection. Probably because it doesn't make logical sense to add something to my calendar, but then have me not attending.

Also, would any of this make any difference using a Meeting item instead of an Appointment item? The definition in the Outlook help I've seen about them is that a Meeting is an Appointment with a second person or a Room or Equipment, etc.

Any thoughts on this greatly appreciated.
Dim oApp As Outlook.Application
  Dim oAppt As Outlook.AppointmentItem
  Dim oRecipts As Outlook.Recipients
  Dim oRecipt As Outlook.Recipient

    Set oApp = CreateObject("Outlook.Application")
    Set oAppt = oApp.CreateItem(olAppointmentItem)
    With oAppt
        .MeetingStatus = Outlook.OlMeetingStatus.olMeeting
        .Subject = "Intake Appointment for " & Me.txtClientName
        If Not IsNull(Me.txtRoom) Then .Location = Me.txtRoom
        .Start = Me.txtDateTime
        .End = DateAdd("n", Me.txtMinutes, .Start)
        .ReminderMinutesBeforeStart = 5
        .ReminderSet = True
        .BusyStatus = Outlook.OlBusyStatus.olBusy
        .IsOnlineMeeting = False
        .AllDayEvent = False
        
        ' Add interviewer
        Set oRecipts = oAppt.Recipients
        Set oRecipt = oRecipts.Add(Me.txtInterviewer)
        oRecipt.Type = Outlook.OlMeetingRecipientType.olRequired
        .Display

Open in new window

0
Comment
Question by:GordonPrince
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
4 Comments
 
LVL 4

Author Comment

by:GordonPrince
ID: 36815841
I found this
http://msdn.microsoft.com/en-us/library/ms875944(v=EXCHG.65).aspx 
that describes how to do it using CDO.

But since CDO is not supported in Outlook 2010, does anyone know of a way to do this without using CDO?
0
 
LVL 4

Accepted Solution

by:
GordonPrince earned 0 total points
ID: 36817490
Maybe I should just make a new Public Folder with Appointments in it and create the Appointment there. Then email additional recipients + a room to include them.
0
 
LVL 4

Author Comment

by:GordonPrince
ID: 36818122
This looks promising:

'This Visual Basic for Applications (VBA) example uses the GetSharedDefaultFolder method to resolve the Recipient object representing Dan Wilson, and then returns Dan's shared default Calendar folder.
Sub ResolveName()
	Dim myOlApp As Outlook.Application
	Dim myNamespace As Outlook.NameSpace
	Dim myRecipient As Outlook.Recipient
	Dim CalendarFolder As Outlook.MAPIFolder
	Set myOlApp = CreateObject("Outlook.Application")
	Set myNamespace = myOlApp.GetNamespace("MAPI")
	Set myRecipient = myNamespace.CreateRecipient("Dan Wilson")
	myRecipient.Resolve
	If myRecipient.Resolved Then
		Call ShowCalendar(myNamespace, myRecipient)
	End If
End Sub

Sub ShowCalendar(myNamespace, myRecipient)
	Dim CalendarFolder As Outlook.MAPIFolder
	Set CalendarFolder = _
        myNamespace.GetSharedDefaultFolder _
        (myRecipient, olFolderCalendar)
	CalendarFolder.Display
End Sub

Open in new window

0
 
LVL 4

Author Closing Comment

by:GordonPrince
ID: 36915987
no experts commented, one of my ideas turned out to be workable
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question