Access to Outlook (1 Viewer)

E

Enigma

Guest
I'm trying to create appointments in Outlook from Access but I'm having problems creating appointments in new customer calendars.

The code:
Dim outobj As Outlook.Application
Dim outappt As Outlook.AppointmentItem
Set outobj = CreateObject("outlook.application")
Set outappt = outobj.CreateItem(olAppointmentItem)

only created appointments in the default Calendar. How to you insert an appointment into a seperate calendar ??

Many help on this would be great.
 

paulmcdonnell

Ready to Help
Local time
Today, 16:08
Joined
Apr 11, 2001
Messages
167
Appointments

Hi

This code works for me I've shown you have I set a variable to be the mailboxes. (I use an exchange sever.)

Hope this helps

paul
_________________________________________________


....
If Me.seen = "JB" Then
who = "Mailbox - Jeremy Burditt"
ElseIf Me.seen = "MR" Then
who = "Mailbox - Martin Rashdi"
ElseIf Me.seen = "TD" Then
who = "Mailbox - Tim Alexander-Dann"
End If


Dim onmapi As NameSpace
Dim ofcPersonalFolders As Folders
Dim offolder As MAPIFolder
Dim iFor As Integer
Dim ol As Outlook.Application
Dim olns As NameSpace
Set ol = New Outlook.Application
Set olns = ol.GetNamespace("MAPI")



Set ofcPersonalFolders = olns.Folders.Item _
(who).Folders
Set offolder = ofcPersonalFolders.Item(1)
Dim outobj As Outlook.Application
Dim outappt As Outlook.AppointmentItem
Set outobj = CreateObject("outlook.application")
Set outappt = outobj.CreateItem(olAppointmentItem)

Set outappt = offolder.Items.add(olAppointmentItem)

With outappt
.start = Me!App_date & " " & Me!App_time
.Duration = 60
.subject = Me.App_type & ": '" & Me.forename & " " & Me.surname & "' [" & Me.company & "] " & "[LOC:--> " & Me.Notes & "]" & " [Sal/Bon: £" & Me.salary & " / £" & Me.Exp_Bonous & "] " & "(By: " & Me!App_by & ") " & " (for: " & Me!Seen_by & ") " & " [ref: " & Me!CallID & "] "
.ReminderMinutesBeforeStart = 60
.ReminderSet = True
.body = Me!CallID
If Not IsNull(Me.Notes) Then .body = Me.Notes
.save
End With

' Release the Outlook object variable.
Set outobj = Nothing

End Sub
 

Users who are viewing this thread

Top Bottom