473,379 Members | 1,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Outlook.Application "User-defined type not defined"

135 100+
Hi,

I am currently using this code I found on the internet to send an appointment to Outlook:
Expand|Select|Wrap|Line Numbers
  1. orm_frmAppointments!ApptDate = [Form_Maintenance Subform3]![Next Maintenance]
  2. 'Form_frmAppointments!ApptTime = Me![Sample Run Time]
  3. Form_frmAppointments!Appt = "BacT" & " " & Me![Combo100] & " " & "Remove from Incubator at " & Me![Sample Run Time] & " " & Me![Sample Run Date] + 1
  4. Form_frmAppointments!ApptReminder = True
  5.  
  6.  
  7.  
  8. ' Save record first to be sure required fields are filled.
  9. DoCmd.RunCommand acCmdSaveRecord
  10. ' Exit the procedure if appointment has been added to Outlook.
  11. 'If Form_frmAppointments!AddedToOutlook = True Then
  12. If Me!Outlook = True Then
  13. MsgBox "This appointment has already been added to Microsoft Outlook"
  14. Exit Sub
  15. ' Add a new appointment.
  16. Else
  17. Dim outobj As Outlook.Application
  18. Dim outappt As Outlook.AppointmentItem
  19. Set outobj = CreateObject("outlook.application")
  20. Set outappt = outobj.CreateItem(olAppointmentItem)
  21. With outappt
  22. .Start = Form_frmAppointments!ApptDate & " " & Form_frmAppointments!ApptTime
  23. .Duration = Form_frmAppointments!ApptLength
  24. .Subject = Form_frmAppointments!Appt
  25. .Categories = "Important"
  26. If Not IsNull(Form_frmAppointments!ApptNotes) Then .Body = Form_frmAppointments!ApptNotes
  27. If Not IsNull(Form_frmAppointments!ApptLocation) Then .Location = _
  28. Form_frmAppointments!ApptLocation
  29. If Form_frmAppointments!ApptReminder Then
  30. .ReminderMinutesBeforeStart = Form_frmAppointments!ReminderMinutes
  31. .ReminderSet = True
  32. End If
  33. .Save
  34. End With
  35. End If
  36. ' Release the Outlook object variable.
  37. Set outobj = Nothing
  38. ' Set the AddedToOutlook flag, save the record, display a message.
  39. Form_frmAppointments!AddedToOutlook = True
  40. Me!Outlook = True
  41. DoCmd.RunCommand acCmdSaveRecord
  42. MsgBox "Appointment Added!"
  43. Exit Sub
  44. AddAppt_Err:
  45. MsgBox "Error " & Err.Number & vbCrLf & Err.Description
  46. Exit Sub 
I have copied the code to another database project I am working on. In this new database the code is giving an error and I don't know why. The error takes place on line #17. I get the "User-defined type not defined" error. This code works great in my other database so I am wondering if there is something else I need to do that I just can't remember to get it to work right in the new database. Any ideas?
Oct 24 '10 #1
1 5940
MyWaterloo
135 100+
Never mind. I didn't have a reference set to the Microsoft Outlook Object Library. I thought I did but guess not.
Oct 24 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Vance Kessler | last post by:
Yes, yes, I know why are we using Crystal 7 under Windows 2003. Well we have to for now. We had a website that was working just fine under Windows 2000 then we re-staged the boxes upgraded to...
0
by: Frederick Noronha \(FN\) | last post by:
---------- Forwarded message ---------- Solutions to Everyday User Interface and Programming Problems O'Reilly Releases "Access Cookbook, Second Edition" Sebastopol, CA--Neither reference book...
1
by: John Beard | last post by:
I downloaded the attached code from MS. It flips on the "User Cannot Change Password" on a user in AD and works great from a console or windows app, but when put into an ASP.NET app I get a "The...
1
by: nico1469 | last post by:
Hello all, Once windows mmi programming was very easy - vb forms.. nice & easy. nowdays, our customers have became IE freaks !!! So, my question is, what is the best way to develop mmi in the...
2
by: HvG | last post by:
I'm sure this is a trivial question, but I cannot create an Outlook Object from a WebForm app, but can from a console app. or a Windows app. My COM knowledge is very poor sorry. ...
1
by: ranabhavin2 | last post by:
Hi, I have made database chat application in asp.net. now suppose I have two chat window at different computer. If user1 writing something to user2 then at the bottom there shuold be message...
0
by: whosyodaddy1019 | last post by:
Does anyone have any code that can do this. From what I understand, these are flags in the "userAccountControl" properties but unsure how to get it unchecked. Can anyone help? Imports System...
0
by: FrankieBakerJr | last post by:
Hello all I have an ASP.NET 2003 application (running Windows XP) that allows user to change and reset their Active Directory password. I'm using an admin account to query and reset the passwords...
0
by: =?Utf-8?B?SkhhbGV5?= | last post by:
Our system is: IIS Server: dual Intel Xeon 2.80 GHz, 4 GB Ram Windows Server 2003 SP2 IIS 6.0 SQL Server: dual Intel Xeon 2.80 GHz, 4 GB Ram (separate server) Windows Server 2003 SP2 SQL...
1
by: chrisli | last post by:
Hello, i'm trying to make an Application which can get every Calendar entry from a FOREIGN User in Outlook on a Exchange 2003 Server. At the moment i can only get my own calender entries. But...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.