-
Create appointments into windows live calendar using outlook vba
I want to create an appointment into my windows live mail from within outlook.
At this moment I've got a script working which creates an appointment in the Calendar called "Calendar" within the calendar group "My Calendars".
But I want the appointment to go into the windows live calendar which I've put in an other calendar group called "Vlaming".
I've got the following script (not completed but it does create an appointment within the "Calendar"):
[VBA]Sub NewAppointment(oMail As Outlook.MailItem)
'/* Create the Outlook Object and Appointment Item */
MsgBox ("Begin NewAppointment")
Dim app As New Outlook.Application
Dim appointment As AppointmentItem
Dim csvData() As String
Set appointment = app.CreateItem(olAppointmentItem)
csvData = Split(oMail.Subject, ",")
appointment.Subject = csvData(APP_SUBJECT)
appointment.Save
MsgBox ("End NewAppointment-1")
End Sub[/VBA]
If I select the windows live mail calendar and I perform within the Immediate:
? application.activeexplorer.currentfolder.folderpath
it says
\\xxxxvlaming@live.nl\Xxxx's calendar
Please can anyone help? I've read something about defaultfolders but I don't understand it yet.
-
Is there really no one with experience on this issue?
I have also searched for the API of the Outlook Hotmail Connector but couldn't find that also. (
-
CreateItem will always create the item in your default folder for the item type you specify. For non-default folders, you need to walk the folder hierarchy using the Folders collection. So it would have to be something like
[VBA]
Application.GetNamespace("MAPI").Folders("xxxxvlaming@live.nl").folders("Xxxx's calendar")
[/VBA]
-
Thanks
Thank you very much JP2112.
Thanks to your reply I managed to create an appointment in my non-default windows-live-calendar within outlook. The following statement did the job.
[VBA]
Set appointment = Application.GetNamespace("MAPI").Folders("xxxx@live.nl").Folders("xxxx calendar").Items.Add
[/VBA]
Now I can create appointment(s) in my live-calendar by mailing a CSV-file or a CSV-line.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules