Adodb Connection To Outlook Calendar Appointment
I'm connecting to Outlook using Adodb. (ADO is a requirement)
With ADOConn
.Provider = "Microsoft.JET.OLEDB.4.0"
.ConnectionString = "Exchange 4.0;" _
& "MAPILEVEL=" & mailboxname & "|;PROFILE=Outlook;" _
& "TABLETYPE=0;DATABASE=C:\WINDOWS\TEMP\;"
.Open()
End With
then using the sql
Select * from Calendar
which returns the Appointments, but with no start or finish times.
Does anyone know how I can retrieve this information this way?开发者_如何学Python
Do you have to use ADODB? If not, you can try this:
Dim ola As New Outlook.Application
Dim oln As Outlook.NameSpace = ola.GetNamespace("MAPI")
Dim olc As Outlook.MAPIFolder = oln.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar)
For Each item As Outlook.AppointmentItem In olc.Items
MsgBox(item.Subject & vbCrLf & item.Start & vbCrLf & item.End)
Next
If you do have to use ADODB, then can you post the portion of the code where you are trying to read the start and end times?
精彩评论