A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Reading outlook appoinment details into access database



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 20th 08, 12:32 PM posted to microsoft.public.outlook.program_vba
TheShack
external usenet poster
 
Posts: 1
Default Reading outlook appoinment details into access database

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 03:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.