VBscript outlook form creating meeting in specific calendar

后端 未结 1 1222
渐次进展
渐次进展 2021-01-27 18:36

I\'ve been working on this the past few days. My VBscript code works and will create a meeting in the default calendar in Outlook. The part I can\'t seem to figure out is how to

1条回答
  •  隐瞒了意图╮
    2021-01-27 19:23

    Items are added to non-default calendars.

    Sub Add_To_NonDefault_Folder()
    
        Dim objNameSpace As NameSpace
        Dim objCalendar As Folder
        Dim objHoliday As AppointmentItem
    
        Set objNameSpace = GetNamespace("MAPI")
        Set objCalendar = objNameSpace.GetDefaultFolder(olFolderCalendar).Folders("Test")
    
        Set objApptItems = objCalendar.items
        Set objHoliday = objCalendar.items.Add(olAppointmentItem)
    
        objHoliday.Subject = "Appt test"
        objHoliday.SAVE
    
    End Sub
    

    0 讨论(0)
提交回复
热议问题