Has anyone used the outlook calender code on Ken Rays Sons of Thunder website http://www.sonsothunder.com/devres/live ... iac002.htm, it seems to be the only site with info on this subject,
i have tried using it in a stack but it doesn't work, i tried saving the uVBScript code in the custom properties of the stack itself and then in the custom props of the button, i'm probably missing something very obvious here, if anyone can help - please.
Communicating with Outlook
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Communicating with Outlook
Hi wullie,
That post needs some updating:
This should go into the stacks custom property uVBScript
And in the button:
Aside from the custom script I did do a few changes to the button script
tEnd is now in minutes from tStart
and I am using the desktop to put the vbscript.
Simon
Edit: This is working with Outlook 2010 Windows (naturally)
That post needs some updating:
This should go into the stacks custom property uVBScript
Code: Select all
Const olAppointmentItem = 1
Set objOutlook = CreateObject("Outlook.Application")
Set objAppointment = objOutlook.CreateItem(olAppointmentItem)
objAppointment.Start = #<<START_DATE_TIME>>#
objAppointment.Duration = <<END_DATE_TIME>>
objAppointment.Subject = "<<SUBJECT>>"
objAppointment.Body = "<<BODY>>"
objAppointment.ReminderMinutesBeforeStart = <<REMIND_MINS>>
objAppointment.ReminderSet = True
objAppointment.Save
Code: Select all
on mouseUp
put "9/3/13 9:00AM" into tStart
put "60" into tEnd
put "Doctor's Appointment" into tSubject
put "Call 555-5555 beforehand to confirm." into tBody
put 30 into tRemindMins
SetAppointment tStart,tEnd,tSubject,tBody,tRemindMins
end mouseUp
on SetAppointment pStart,pEnd,pSubject,pBody,pRemindMins
put the uVBScript of this stack into tScript
replace "<<START_DATE_TIME>>" with pStart in tScript
replace "<<END_DATE_TIME>>" with pEnd in tScript
replace "<<SUBJECT>>" with pSubject in tScript
replace "<<BODY>>" with pBody in tScript
replace "<<REMIND_MINS>>" with pRemindMins in tScript
runScript tScript
end SetAppointment
on runScript pVBS
set the hideConsoleWindows to true
put specialFolderPath("desktop") & "\temp.vbs" into tTempPath
put pVBS into url ("file:" & tTempPath)
get shell("cscript.exe //nologo" && tTempPath)
send "delete file" && quote & tTempPath & quote to me in 1 second
-- this gives enough time for the script to run before you delete it
end runScript
tEnd is now in minutes from tStart
and I am using the desktop to put the vbscript.
Simon
Edit: This is working with Outlook 2010 Windows (naturally)
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 78
- Joined: Fri Oct 03, 2008 10:13 am
Re: Communicating with Outlook
Outstanding Simon, it works superbly , thank you so much for your help
kindest regards
Wullie

kindest regards
Wullie
Re: Communicating with Outlook
Glad it works for you!
Using C:\temp.vbs wasn't working for me, you probably want to change desktop to documents.
Simon
Using C:\temp.vbs wasn't working for me, you probably want to change desktop to documents.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!