Invite Attendee - TO field

  • Thread starter Thread starter Wanda
  • Start date Start date
W

Wanda

We can call up an appointment with code, but how do we
invoke the "invite attendees" function so we can add in an
address? Here is the code we were working with. We
receive no errors, but it does not invoke the TO field.
Thanks. Wanda
**************
Sub cmdAppInvite_Click()
Dim objNewAppointment
Dim objCustomForm3
Dim objCustomForm1

Set objNewAppointment = Application.CreateItem(1)
Set objCustomForm3 = Item.GetInspector.ModifiedFormPages
("3 Week").Controls
Set objCustomForm1 = Item.GetInspector.ModifiedFormPages
("Basic Info").Controls

With objNewAppointment
Item.Recipients.Add("(e-mail address removed)")
.Subject = objCustomForm3("txtZEN3")
.Body = "How are you today?"
objNewAppointment.Display

Set objNewAppointment = Nothing
Set objCustomForm1 = Nothing
Set objCustomForm3 = Nothing
End With
End Sub
 
Adding addresses to the Recipients collection effectively populates the To:
field AND the list of attendees. Am I misunderstanding your problem?
 
Sorry, I didn't think this was possible and thought that
was why I wasn't getting an answer.

Yes, I believe we are on the same page. We create ZEN
objects and want to send out an appointment for our test
team to test it by a certain date (called from within a
custom form ... command button). I am able to
automatically populate the subject, body using variables,
but I need the TO field to appear, so I can populate the
test team's address. My thought was to call up a custom
appointment that already has the TO field present (bring
up an appointment, invoke Invite Attendees and then save
the oft form and the TO field will always be present) ...
just not sure if that is possible either.

Thanks very much for your comments.

Wanda
 
Now I'm a little puzzled. You can't see the To: field? That should be
visible on the form for Meeting Requests. The To: field is not available
for Appointments.

What are ZEN objects? Sounds like programming nirvana...
 
You are correct. I am pulling up an appointment
(application.createItem(1)) which does not have the To:
field. I need that To: field. Is there a code that can
pull up a Meeting Request? That would be perfect.

ZEN objects are Novel objects. Objects created to push
out applications/patches, etc to our clients. In doing
this, there are a number of constant procedures to
follow. I have created a custom Task form that steps us
through each procedure to create a ZEN object and one of
the steps is to automatically send out a meeting request
for testing purposes. Actually the custom Task form is
pretty neat. I would send you the OFT, but I'm sure you
would not find it interesting, as your coding abilities
would be superb compared to what I can do at this
point. :)

Thanks again for your help. It is greatly appreciated.

Wanda
 
Ah, I see. MeetingItem objects can't be created directly, but you are on
the right track. You have to change the MeetingStatus property in the
AppointmentItem object and then the To: will be enabled, and you can add
attendees to the Recipients collection. The e-mail that the attendees
receive is the actual MeetingItem object. The code below from the help file
(from the MeetingStatus property section) has a perfect example for your
situation:

Sub CreateAppt()
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olAppointmentItem)
myItem.MeetingStatus = olMeeting
myItem.Subject = "Strategy Meeting"
myItem.Location = "Conference Room B"
myItem.Start = #9/24/1997 1:30:00 PM#
myItem.Duration = 90
Set myRequiredAttendee = myItem.Recipients.Add("Nate Sun")
myRequiredAttendee.Type = olRequired
Set myOptionalAttendee = myItem.Recipients.Add("Kevin Kennedy")
myOptionalAttendee.Type = olOptional
Set myResourceAttendee = myItem.Recipients.Add("Conference Room B")
myResourceAttendee.Type = olResource
myItem.Display
End Sub
 
Back
Top