![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hello. I'm new to VBA programming and need a bit of help. After searching the
internet I have found the following VBA code to add an appointment into outlook from Access. I also need to be able to import appointments created in outlook into an access table. How can I do this and can it be done using automation? Thanks Private Sub cmdAddAppt_Click() On Error GoTo Add_Err 'Save record first to be sure required fields are filled. DoCmd.RunCommand acCmdSaveRecord 'Exit the procedure if appointment has been added to Outlook. If Me!AddedToOutlook = True Then MsgBox "This appointment is already added to Microsoft Outlook" Exit Sub 'Add a new appointment. Else Dim objOutlook As Outlook.Application Dim objAppt As Outlook.AppointmentItem Dim objRecurPattern As Outlook.RecurrencePattern Set objOutlook = CreateObject("Outlook.Application") Set objAppt = objOutlook.CreateItem(olAppointmentItem) With objAppt .Start = Me!ApptStartDate & " " & Me!ApptTime .Duration = Me!ApptLength .Subject = Me!Appt If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes If Not IsNull(Me!ApptLocation) Then .Location = Me!ApptLocation If Me!ApptReminder Then .ReminderMinutesBeforeStart = Me!ReminderMinutes .ReminderSet = True End If .Save .Close (olSave) End With 'Release the AppointmentItem object variable. Set objAppt = Nothing End If 'Release the Outlook object variable. Set objOutlook = Nothing 'Set the AddedToOutlook flag, save the record, display a message. Me!AddedToOutlook = True DoCmd.RunCommand acCmdSaveRecord MsgBox "Appointment Added!" Exit Sub Add_Err: MsgBox "Error " & Err.Number & vbCrLf & Err.Description Exit Sub End Sub |
Ads |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reading Details of the Shared Calendar from a Customized Meeting Request Form | Vidya[_2_] | Outlook - Using Forms | 2 | November 6th 07 11:28 AM |
Importing Access Database to Outlook | JeremyStewart1 | Outlook - Using Contacts | 2 | January 3rd 07 04:37 PM |
Outlook contacts in Access Database | Gunnarh | Outlook - Installation | 1 | June 8th 06 12:23 PM |
Using data in Access database in outlook forms | Weatherman | Outlook and VBA | 6 | April 20th 06 12:46 AM |
getting data from Access Database in Outlook Form | Weatherman | Outlook - Calandaring | 1 | April 17th 06 01:49 PM |