Sue,
Still generates runtime error 287 (Application-defined or object-defined
error) at the final line of the code segment shown below.
Dim objApp As Application
Dim objItem As Outlook.AppointmentItem
Dim objSelection As Selection
Dim objAttendees As Outlook.Recipients
Dim objAttendeeReq As String
Dim objAttendeeOpt As String
Dim objOrganizer As String
Dim dtStart As Date
Dim dtEnd As Date
Dim dtCreate As Date
Dim strSubject As String
Dim strLocation As String
Dim strNotes As String
Dim strMeetStatus As String
Dim strUnderline As String ' Horizontal divider line
'added by Hugh
Dim x
Dim myMailItem
Dim strNoteBody
Dim iAccepted As Integer
Dim iDeclined As Integer
Dim iTentative As Integer
'to add office location
Dim strInvitee
'to gather office info from AD
Dim strLDAP
Dim strADOffice
Dim strADAddress
Dim strADCity
Dim strADState
Dim strADCountry
Dim strADPhone
'to check the invitee is a user
Dim myRecipient
'define hjs variables
iAccepted = 0
iDeclined = 0
iTentative = 0
Set objApp = CreateObject("Outlook.Application")
' Is it an appointment
If objApp.ActiveInspector.CurrentItem.Class <> 26 Then
MsgBox "This feature only works on items in your Calendar. Open an
Appointment and try again.", _
vbExclamation, _
"Not an Appointment"
GoTo EndClean
Else
Set objItem = objApp.ActiveInspector.CurrentItem
End If
Set objSelection = objApp.ActiveExplorer.Selection
Set objAttendees = objItem.Recipients
--
Dale
"Sue Mosher [MVP]" wrote:
> Don't use this statement in Outlook VBA:
> Set objApp = CreateObject("Outlook.Application")
> Instead, use the intrinsic Application object:
> Set objApp = Application
> Once you check the Class property of the item, you can use the appropriate
> object, e.g.
> Dim objAppt as Outlook.AppointmentItem
> '<snip
> Set objItem = objApp.ActiveInspector.CurrentItem
> If objItem.Class = olAppointment Then
> Set objAppt = objItem
> Set objAttendees = objItem.Recipients
> 'etc.
> > Sue Mosher
> > >
> "Dale Fye" <dale.fye@nospam.com> wrote in message
> news:1E922077-BFA7-4567-A0A5-0326952B38F2@microsoft.com...
> > Thanks Sue,
> > I'm using the code from:http://www.outlookcode.com/codedetail.aspx?id=1418
> > Dim objApp As Outlook.Application
> > Dim objItem As Object
> > Dim objSelection As Selection
> > Dim objAttendees As Outlook.Recipients
> > ...
> > Set objApp = CreateObject("Outlook.Application")
> > Set objItem = objApp.ActiveInspector.CurrentItem
> > Set objSelection = objApp.ActiveExplorer.Selection
> > Set objAttendees = objItem.Recipients
> > objitem.class = 26
> > Since ObjItem is defined as an Object, there is no intellisense, so I'm
> > out
> > of my element. Hell, the entire Outlook object model is "out of my
> > element"!
> > ;-)
> > I tried several different Outlook objects but each returned an error in
> > another area. I assume the reason this is declared as an object is that
> > the
> > user could have any outlook object open when this code is run.
> > --> > Dale
> > "Sue Mosher [MVP]" wrote:
> >
> >> Which code sample are you using? What is the statement that instantiates
> >> objItem? What's the value of objItem.Class?
> >
> >> "Dale Fye" <dale.fye@nospam.com> wrote in message
> >> news:9EB7CCB2-A6DD-4CF4-B778-919EB4F17AFA@microsoft.com...
> >> > figured out how to get to the VBA editor but now:
> >> >> > I copied the code into a code module in Outlook 2007, and am getting an
> >> > error (287 Application-defined or object defined error) on the line:
> >> >> > Set objAttendees = objItem.Recipients
> >> >> > When I print objItem in the debug window, it gives me the subject of
> >> > the
> >> > meeting.
> >> >> > I've got a meeting request that I created up on screen.
> >> >> > "Sue Mosher [MVP]" wrote:
> >> >> >> It's stored in the Appointment.Recipients collection; see
> >> >> http://www.outlookcode.com/codedetail.aspx?id=1130 and
> >> >> http://www.outlookcode.com/codedetail.aspx?id=1418 for Outlook VBA
> >> >> code
> >> >> samples.
> >> >
> >> >> "Dale Fye" <dale.fye@nospam.com> wrote in message
> >> >> news:19F7EC8D-5466-43F1-B92B-4E35B364FACE@microsoft.com...
> >> >> >I have cross posted this to the Access-General, Outlook-General, and
> >> >> > Outlook-programming-vba news groups to expand my pool of expertise.
> >> >> >> >> > I have a co-worker that wants to be able to print out the list of
> >> >> > invitees
> >> >> > and threir responses to a meeting request (what is visible when you
> >> >> > select
> >> >> > the "Show - Tracking" ribbon option in 2007. We cannot figure out a
> >> >> > way
> >> >> > to
> >> >> > print or even copy this info. He has more than two pages of
> >> >> > invitees,
> >> >> > and
> >> >> > would prefer not to do a screen print.
> >> >> >> >> > Any ideas?
> >> >> >> >> > Is this information visibile from within VBA? I linked my calendar
> >> >> > to
> >> >> > an
> >> >> > Access database, but did not see a field in the calendar table that
> >> >> > seemed
> >> >> > to
> >> >> > handle meeting attendees.
> >> >
> >> >
> >> >> .
> >> >
> >
> >
> >> .
> >>
> .
>