Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object doesn't support property or method on late bind 2

Status
Not open for further replies.

jeffshex

Technical User
Jun 30, 2005
208
US
I looked at the other thread about late binding and decided to start a new thread.

How ever I try to do late binding, I get the error object doesn't support this property or method.
and it all starts at the .MeetingStatus line.
Even if I comment that line out, it will have the same error on the next and so on.
Code:
    CreateObject("Outlook.Application").CreateItem (olAppointmentItem)
    With CreateObject("Outlook.Application").CreateItem(olAppointmentItem)
    .Subject = [Forms]![frmCM]![txtFullName]
    .MeetingStatus = olMeeting
    .Start = Me.ApptStartDate & " " & Me.ApptStartTime
    .End = Me.ApptStartDate & " " & Me.ApptEndTime
    .Body = "Appointment Type: " & Me.ApptType
    .Send
    End With

I'm not sure what's the reason for that so I'm looking for any guidance possible.
I did have success when I had the reference for my outlook version checked while running this code:
Code:
Dim outMail As Outlook.AppointmentItem
Me.Refresh
Set outMail = Outlook.CreateItem(olAppointmentItem)
outMail.Subject = [Forms]![frmCM]![txtFullName]
outMail.MeetingStatus = olMeeting
outMail.Start = Me.ApptStartDate & " " & Me.ApptStartTime
outMail.End = Me.ApptStartDate & " " & Me.ApptEndTime
outMail.Body = "Meeting Type: " & Me.ApptType
outMail.Send

Obviously I need to support outlook 2003 as well as 07 so I've been told that late binding is the way to go.
I am open to other suggestions though too.
Thanks!
 
Code:
Dim outMail As Object
Set outMail = CreateObject("Outlook.Application").CreateItem(1) '1=olAppointmentItem
With outMail
    .Subject = [Forms]![frmCM]![txtFullName]
    .MeetingStatus = 1 '1=olMeeting
    .Start = Me.ApptStartDate & " " & Me.ApptStartTime
    .End = Me.ApptStartDate & " " & Me.ApptEndTime
    .Body = "Appointment Type: " & Me.ApptType
    .Send
End With

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Very nice.
I knew I was close.
Is there a site to lookup what those create item numbers are for outlook?
 
You can set a reference in Access and then view the "Object Browser" window. This provides a view of all the object classes methods, actions, constants, etc. If you click a constant name, the value appears in the bottom right pane.

If you have the reference set, you can open the debug window and type:
Code:
? olAppointmentItem
1


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top