Update Public Calendar From Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have got my database adding appointments to the outlook schedule however
its adding them to the users schedule, i want all appointments to go to the
maintenance schedule, How can i get the code to call this calendar rather
than the default ??

Cheers

CR
 
You may want to ask this question in an Outlook newsgroup. Access interacts
with Outlook using Automation, so the code to call a specific calendar would
be Outlook code called using Access. Once you have the few lines necessary
to call a specific calendar, either an Outlook MVP or an Access MVP can
easily write the automation code to make it work.
 
I just posted this in a different question, Can you help us both maybe?..

at the moment i am exporting some dates into an appointment from access
using a command button which does this ---
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.
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!Starthire
.Duration = Me!Days
.Subject = Me!JobNo
.end = Me!Endhire
If Not IsNull(Me!Text223) Then .Body = Me!Text223
If Not IsNull(Me!City) Then .Location = Me!City

.Save
.Close (olSave)
End With
'Release the AppointmentItem object variable.
Set objAppt = Nothing
'Release the object variables.
Set objOutlook = Nothing
Set objRecurPattern = Nothing
'Set the AddedToOutlook flag, save the record, display
'a message.
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Appointment Added!"
Exit Sub
Add_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
Exit Sub
End Sub



However this puts it into the personal calendar and i need it to go into the
a public calendar...

I found this code that should work but i cant get them to work together...

Dim myFolder As Object


Set myNameSpace = myOlApp.GetNamespace("MAPI")

Set myFolder = myNameSpace.Folders("Public Folders")
Set myFolder = myFolder.Folders("All Public Folders")
Set myFolder = myFolder.Folders("name of folder")
'If the folder is just below the All Public Folders location. If it is
'elsewhere you keep adding Folders references until you hit the folder
'you want.

Set myFolderItems = myFolder.Items
Set objAppt = myFolderItems.Add(olAppointmentItem)

' olAppointmentItem is standard outlook form. If using custom form it must
be published in Organizational Forms
Library.

Can someone help me put it together so they work??

Thanks...

William
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top