Sync outlook appointments with Groove using vsto
Both outlook and groove contain calendars so which one do you use? Each one has its own strengths but it wocould be cool to be able to sync your appointments. I have created a small sample using vsto and the groove SDK that will allow you to import and export appointments from outlook to groove. I started in my last post, groove 'n' with vsto, where I showed you how to connect to groove using WebServices. now I will continue with the sample application and add support for importing calendar items.
First I created a ribbon for the appointment inspector that allows you to choose the account and workspace you want to pull the calendar from.
Most of this Code for the above screens was in the last post so I wont 'go over it again, although I did refactor it quite a bit as I went along. the next this is to click "add from groove" to select an appointment to import.
I created the calendar picker to let you select the day with appointments, in bold, and then the entry for that day.
Click Import to import the groove appointment into outlook.
Here is the groove appointment
Now imported into outlook.
After you get a reference to the groove workspace You Can interate through the tools until you find the calendar tools.
Public static list
Tools (groovespaces. space workspace) {too many ls. required bytes ls tools = new grooveservices. invalid parameters Ls. required bytes ls (); tools. grooverequestheadervalue = new exploreservices. invalid parameters Ls. grooverequestheader (); tools. grooverequestheadervalue. grooveidentityurl = workspace. identityurl; tools. grooverequestheadervalue. grooverequestkey = requestkey; tools. url = hostportaddress + workspace. tools; List
toolslist = new list
(); toolslist. addrange (tools. read (); Return toolslist ;}
Public static list <export ecalendar. extends ecalendar> calendars (groovespaces. space workspace) {list <your ecalendar. export ecalendar> calendars = new list <export ecalendar. export ecalendar> (); string calendartype = "urn: Groove.net: platform. tools. calendar "; foreach (**ls. tool in tools (workspace) {If (tool. type = calendartype) {Your ecalendar. export ecalendar calendar = new grooveservices. export ecalendar. groovecalendar (); Calendar. grooverequestheadervalue = new exploreservices. export ecalendar. grooverequestheader (); Calendar. grooverequestheadervalue. grooveidentityurl = workspace. identityurl; Calendar. grooverequestheadervalue. grooverequestkey = requestkey; Calendar. url = hostportaddress + tool. data; calendars. add (calendar) ;}} return calendars ;}
Now I just show the calendar picker and populate the outlook appointment. one thing I don't deal with yet in this sample is the fact that you cowould have mulitple calendar tools in a workspace. but it shoshould be easy enough to just add another drop down to let the user pick the calendar.
// Show the calendar entries
Foreach (exploreservices. cancecalendar. cancecalendar calendar in
Exploreservices. groovehelper. Calendars (workspace ))
{
Export ecalendarpicker GCP = new export ecalendarpicker (calendar );
GCP. showdialog ();
If (GCP. calendarentrieslistbox. selectedindex> = 0)
{
Grooveservices. groovecalendar. calendarentry calentry =
(Grooveservices. groovecalendar. calendarentry) GCP. calendarentrieslistbox. selecteditem;
Appointment. Subject = calentry. description;
Appointment. Start = calentry. Start;
Appointment. End = calentry. end;
Appointment. Body = calentry. details;
Appointment. alldayevent = calentry. allday;
}
}
In the next post I hope to show you how to export your outlook appointment to groove.
Also Abbott who is the product manager for groove pointed out that much of the Helper code that I am writing in part of groove helpers. this is really cool, once I get down processing the hard way I wowould like to go back and port my code to the groove helper.
If your at teched 2007 in Orlando next week, stop by the vsto booth and talk to me about the code in detail.