vba - Outlook 2010 VBS how to add meeting to specific calendar -
this question has answer here:
i'm trying set vbs create meeting in specific calendar (not default) when command button pressed. code have works creates meeting in default calendar. i've tried fooling around new vbs (mainly used vba). know vba , vbs similar im sure small has tweaked. want meetings placed in calendar named test, under calendars.
sub commandbutton1_click() if commandbutton1 = false dim objol 'as outlook.application dim objappt 'as outlook.appointmentitem const olappointmentitem = 1 const olmeeting = 1 const olfree = 0 set objol = createobject("outlook.application") set objappt = objol.createitem(olappointmentitem) objappt.subject = "my test appointment" objappt.start = #8/24/17 3:50:00 pm# objappt.duration = 1 objappt.location = "followup" objappt.body = "test verbiage" objappt.reminderminutesbeforestart = 1 objappt.busystatus = olfree objappt.save() set objappt = nothing set objol = nothing end if end sub
try this:
sub commandbutton1_click() if commandbutton1 = false const olappointmentitem = 1 const olmeeting = 1 const olfree = 0 set objoutlook = createobject("outlook.application") set objnamespace = objoutlook.getnamespace("mapi") set objdictionary = createobject("scripting.dictionary") objdictionary.add "august 24, 2017", "my test appointment" colkeys = objdictionary.keys each strkey in colkeys dtmapptdate = strkey strapptname = objdictionary.item(strkey) set objappt = objoutlook.createitem(olappointmentitem) objappt.subject = strapptname objappt.start = dtmapptdate & " 3:50 pm" objappt.duration = 1 objappt.location = "followup" objappt.body = "test verbiage" objappt.reminderset = true objappt.reminderminutesbeforestart = 1 objappt.alldayevent = true objappt.busystatus = olfree objappt.save next end if end sub
wiki
Comments
Post a Comment