trying to export table to Outlook 2007 Calendar

nharrison

Registered User.
Local time
Today, 08:03
Joined
Jun 11, 2009
Messages
55
I've googled as much as I can on the topic, all to no avail. Does anyone know if there is functionality or a work-around that would allow the export of records from a "to-do list" table into Outlook calendar? The only fields I would want to export would be Item Description and Due Date.

Thanks
 
thats perfect. thanks a million, could not have found that myself.
 
by the way Paul, I noticed that the article you linked to applies to Access and Outlook 93. I've researched and I know automation is still a function available in Office 2007, but I'm no pro at VBA. I'm proficient with C++ and have dabbled in other languages, but I am unfamiliar with syntax and commands in VBA. This being said, would you mind looking at that link and telling me if the code presented there would function in Access 2007, and if not, if I could adapt it myself to?

Thanks.
 
It should, yes. If you're in an environment where the versions of Outlook may differ, you'll also want to check out "late binding", since code written that way should work with any version of Outlook. That would change the code slightly, and remove the step where you set a reference to a specific Outlook library. If you don't find that code right away, let me know and I'll dig up a link.
 
Actually, I followed the tut verbatim and it worked like a charm. The only modification that would be better is an option for manual override, when the script gives the alert "This appointment already added to Microsoft Outlook", to where instead it displays something like "This appointment has already been added to Microsoft Outlook. Are you sure you want to export it to your calendar?" And then yes/no choices to continue.

I really am in over my head and would appreciate if you could lend a hand with this quick change.

for your reference here's the code I'm using at the moment...

Code:
Private Sub AddAppt_Click()
         On Error GoTo AddAppt_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 already added to Microsoft Outlook"
            Exit Sub
         ' Add a new appointment.
         Else
            Dim outobj As Outlook.Application
            Dim outappt As Outlook.AppointmentItem
            Set outobj = CreateObject("outlook.application")
            Set outappt = outobj.CreateItem(olAppointmentItem)
            With outappt
               .Start = Me!ApptDate & " " & 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
            End With
         End If
         ' Release the Outlook object variable.
         Set outobj = Nothing
         ' Set the AddedToOutlook flag, save the record, display a message.
         Me!AddedToOutlook = True
         DoCmd.RunCommand acCmdSaveRecord
         MsgBox "Appointment Added!"
      Exit Sub
AddAppt_Err:
         MsgBox "Error " & Err.Number & vbCrLf & Err.Description
         Exit Sub

End Sub
 
Here's the basics for a Yes/No box, if that's what you're after:

Code:
Dim msg As String, button As Variant, title As String, response As Variant
msg = "Vehicle is Shopped - Do you want to dispatch anyway?"
button = vbYesNo + vbDefaultButton2
title = "Vehicle Shopped!"

response = MsgBox(msg, button, title)
If response = vbYes Then
  'what to do if yes
Else
  'what to do if not
End If
 
Thanks, that did the trick. *sighs* looks like I might have to learn VBA after all...
 
No "sighs"; it's "oh goody I get to learn VBA!" :p

That's where much of the real power is, so might as well get your feet wet.
 
So I'm coming to realize. I'm only reluctant because it will take time, but I can see that it will be worth it; that's where the true power in Access lies - or in any Office program for that matter.
 

Users who are viewing this thread

Back
Top Bottom