Microsoft
Software
Hardware
Network
Question : Ms Access/Outlook Appointment system
Hey,
Using help on here i managed to make a script that when i clicked a button in Access it would add an appointment into someones calender, this is the coding ive been using,
Private Sub AddAppt_Click()
On Error GoTo ErrorHandler
Dim appOutlook As Outlook.Application
Dim nms As Outlook.NameSpace
Dim Appt As Outlook.AppointmentItem
Dim dteStartTime As Date
Dim dteEndTime As Date
dteStartTime = CDate(CStr(DateAdd("d", 2, Date)) & " 9:00 AM")
dteEndTime = CDate(CStr(DateAdd("d", 2, Date)) & " 10:00 AM")
Set appOutlook = GetObject(, "Outlook.Application")
Set Appt = appOutlook.CreateItem(olAp
pointmentI
tem)
With Appt
.Subject = Me!Appt
.Start = dteStartTime
.End = dteEndTime
If Not IsNull(Me!ApptLocation) Then .Location = _
Me!ApptLocation
If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes
.Recipients.Add ("
[email protected]
.
uk")
.Display
.Send
End With
ErrorHandlerExit:
Set appOutlook = Nothing
Exit Sub
ErrorHandler:
If Err.Number = 429 Then
Set appOutlook = CreateObject("Outlook.Appl
ication")
Resume Next
Else
MsgBox "Error No: " & Err.Number _
& " in CreateApptWithRecipient procedure" _
& "; Description: " & Err.Description
Resume ErrorHandlerExit
End If
End Sub
My only problem now is every time i click the button i get an error that comes up saying "Compile error user defined type not defined" it then highlights this part "Dim appOutlook As Outlook.Application" ...... I am using MS Outlook and Access 2003 on a windows 7 operating system.
Thanks
Answer : Ms Access/Outlook Appointment system
Looks good to me.
Random Solutions
Canon iR 2200 set IP adrress
Installing SSL certifcate on exchange 2010
How can you search e-mail within Outlook 2010 and not use the index?
New Hire Workflow in WSS
Sun Certified Developer for Java Web Services 5 - Study guide/suggestions
MPP microsoft project plan. How can i open a file created in ver 2010 in MPP 2003 or 2007.
Convert PDF into Excel spreadsheet
iSCSI Performance Tuning
Is there a way to provide a range of values to the decode feature of SQL Query?
Exchange 2010 importing multiple PST?