The bit I need help with here isn't actually in access, but its possible it will help others using access, as the data I'm using here is in an excel table linked to the database. (if there is a better way please let me know.)
Basically I have a table in excel with data I want on an outlook calendar. Most of this is working thanks to some help, but I'm doing something wrong here. Here is the code:
Code:
Private Sub CreateAppointment(ws As Excel.Worksheet, lngRow As Long)
Dim oAppt As Object 'Outlook.AppointmentItem
Dim blnCreated As Boolean
Dim oFolder As Object 'Outlook.MAPIFolder
Dim lngAddRow As Long
'On Error Resume Next
Set oFolder = oNS.GetDefaultFolder(&H9) ' olFolderCalendar
Set oAppt = oFolder.Items.Add(&H1) ' olAppointmentItem
Application.StatusBar = "Adding " & ws.Cells(lngRow, 1).Value
With oAppt
'Define calendar item properties
.Start = ws.Cells(lngRow, 7).Value + ws.Cells(lngRow, 8).Value
'.End = ws.Cells(lngRow, 7).Value + TimeValue("01:00:00")
.Subject = ws.Cells(lngRow, 1).Value
.Location = ws.Cells(lngRow, 6).Value
.AllDayEvent = True
.Body = "Hardwired signals: "
.BusyStatus = False
'.ReminderMinutesBeforeStart = ws.Cells(lngRow, 7).Value - TimeValue("00:30:00")
.ReminderSet = False
.Categories = shtImport.Range("CategoryName").Value
'.Send = "test@test.com"
.Save
All the code works fine except for the bit I've added. Where it says .send and the test email. I cant get this working at all. I want all new appointments to be sent to a default email for tracking purposes. (they will be dealt with there via outlook rules.)
Hope someone can advise.