Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Posting a new appointment in someone else's Outlook Calendar

Status
Not open for further replies.

Alkemac

IS-IT--Management
Jun 3, 2003
23
0
0
ZA
Can someone please check the attached code and tell me what else needs to be added to create a new appointment in someone else's Outlook Calendar ? I dont seem to be able to get the part(.subject, .start etc) to work as it always complains its not part of the collection..

Thanks

Set olMAPI = GetObject("", "Outlook.Application").GetNamespace("MAPI")
Set myRecipient = olMAPI.CreateRecipient("Test User")
myRecipient.Resolve
If myRecipient.Resolved Then
Set schedmar = olMAPI.GetSharedDefaultFolder(myRecipient, olFolderCalendar)
' With schedmar
' .Subject = "Test application"
' .Start = DateSerial(2003, 7, 12) + TimeSerial(9, 30, 0)
' .End = DateSerial(2003, 7, 12) + TimeSerial(9, 45, 0)
' .ReminderPlaySound = True
' .Save
' End With
'
Else
MsgBox "Name not resolved"
End If

End Sub
 
Hi Alkemac,

Did you ever figure out how to Post a new appointment in someone else's Outlook Calendar? I am having the exact same problem.

Please help.
 
Hi - Unfortunately, no one helped. I tried this URL and looked at the OutlookSpy option.. To be honest, I didn't explore it further.

If you dont come right, let me know and I'll try and help you.
 
Hi,

Believe it or not, I figured it out not long after I posted this, I found it on the web, can't remember where. It is slightly different but it does work.

Set objOLApp = CreateObject("Outlook.Application")
Set objNS = objOLApp.GetNamespace("MAPI")
strUser = "email address of users calendar to be added to"
Set objRecip = objNS.CreateRecipient(strUser)
objRecip.Resolve
Set objFolder = objNS.GetSharedDefaultFolder( _
objRecip, olFolderCalendar)
Set objAppt = objFolder.Items.Add
With objAppt
'Set the appointment properties here
.Subject = "TEST"
.Body = "Sorry for the inconvenience"
.Start = "23/June/2004 " & "12:15"
.Save
End With

Hope this helps you if you still need it
 
Thanks a mill... I'll give it a try...
 
plsh's code will work only if you have create permissions on the person's calendar folder.

Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top