Consulting

Results 1 to 4 of 4

Thread: Create appointments into windows live calendar using outlook vba

  1. #1

    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.

  2. #2
    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. (

  3. #3
    VBAX Expert JP2112's Avatar
    Joined
    Oct 2008
    Location
    Astoria, NY
    Posts
    590
    Location
    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]
    Regards,
    JP

    Read the FAQ
    Getting free help on the web
    My website
    Please use [vba][/vba] tags when posting code

  4. #4

    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
  •