We provide you with VBA scripts and instructions that enable you to connect MS Outlook to the openCRX ical and vcard servlets within just a few minues. With our Outlook ICS and VCF you have access to your openCRX activities and accounts directly from within Outlook. We have tested these scripts with both MS Outlook 2003 and MS Outlook 2007. If you get them to work with other versions,
.
Visual Basic for Applications must be installed (this is included if you purchased MS Outlook, but it may not be installed on your computer). Without Visual Basic for Applications installed, however, you will not be able to install/run our VBA scripts...
Installation:
unzip the downloaded file to a temporary directory, e.g. C:\temp
start MS Outlook
press <ALT>-<F11> to start Visual Basic
select File > Import File
and then navigate to the file ProgressBox.frm in C:\temp and import it
select File > Import File
and then navigate to the file openCRX.bas in C:\temp and import it
Rename the project (which is probably call Project1 or similar) to CRX
close Visual Basic
back in Outlook select Tools > Customize
select the tab [Toolbars] and create a new toolbar openCRX
select the tab [Commands] and then select Macros (from Categories)
you should now see 3 commands CRX.getContacts, CRX.getCalendars and CRX.putCalendars
drag the command CRX.getContacts to the toolbar openCRX
drag the command CRX.getCalendars to the toolbar openCRX
drag the command CRX.putCalendars to the toolbar openCRX
place the toolbar openCRX in a location you like
close the dialog box Customize
That's it - you should now have a new toolbar called openCRX with 3 buttons as follows:
It is recommended that you have a look at the relevant chapters (Groupware, etc.) of the openCRX Admin Guide if you want to fully understand the concepts. Here we show you how to create and configure a new calendar in MS Outlook that connects to the homepage of an openCRX user named guest:
start MS Outlook
select File > New > Calendar to open the dialog window Create New Folder
enter a name (e.g. openCRX Homepage) and select Calendar Items from the drop down Folder contains:
click OK and Outlook will create a new calendar - you should see this calendar openCRX Homepage in the folder list:
Right-click on the calendar openCRX Homepage and select Properties from the context menu to open the dialog window openCRX Homepage Properties
Enter the following 3 lines into the field Description: url=http://127.0.0.1:8080/opencrx-ical-CRX/ical?id=CRX/Standard/userhome/guest&resource=activities.ics
user=guest
password=opencrx
You might have to adapt the IP address (put the name or the IP address of your own openCRX Server instead of 127.0.0.1), the port (in case you are not using the default port 8080), the user and the password. Please note that the URL also contains the user, i.e. changing the user from guest to some other name requires that you adapt the URL as well). If your openCRX server is configured for SSL, you can also connect with SSL. The ICS_VCF adapter also supports proxy servers (check the source for details).
Hint: Please also note that the first line with the URL will probably wrap because the dialog window cannot be resized. It is still 3 lines, however, i.e. do not enter line breaks and such in the middle of the URL!
click OK to complete the configuration of the calendar openCRX Homepage
now it's time to give it a try - click on the toolbar button CRX.getCalendars - this will initiate the download of all activities filtered to the homepage of the openCRX user guest; depending on how many activities there are, you might see the following progress window:
Once the download is complete your calendar openCRX Homepage should contain all the activities that openCRX filtered to the homepage of the user guest at the time of the download. You can work with these Outlook Appointments as you see fit, including scheduling, setting recurrence information, etc. The following screen shot shows an example activity downloaded from openCRX:
btw, a click on the link contained in the appointment's body takes your browser directly to the corresponding openCRX activity
With this openCRX adapter you can download all filtered openCRX accounts of an openCRX account filter. Assuming you want to download all your openCRX accounts you can define a trivial account filter as follows:
start your browser, connect to openCRX and login
navigate to Accounts > Account Filters
create a new Account Filter and name it allAccounts:
navigate to this newly created Account Filter allAccounts and create a new Query Filter Property as follows:
here is the clause for easy cut and paste:
object_id IN (
SELECT OOCKE1_ACCOUNT.object_id FROM OOCKE1_ACCOUNT
where (NOT OOCKE1_ACCOUNT.disabled)
)
in the end, your Account Filter allAccounts should look as follows:
Next we create a new contact folder in Outlook:
select File > New > Folder to open the dialog window Create New Folder
enter a name (e.g. openCRX Contacts) and select Contact Items from the drop down Folder contains:
click OK and Outlook will create a new contact folder
right-click on the task folder openCRX Contacts and select Properties from the context menu to open the dialog window openCRX Contacts Properties
now we create the URL to access the vcard servlet with the appropriate parameters (account filter allAccounts):
http://<openCRX_Server_Name_or_IP_address>:<port>/opencrx-vcard-<provider>/vcard?id=<provider>/<segment>/filter/<filter name>&resource=accounts.vcf
In the case of a default installation of openCRX Server the provider is CRX and the segment is Standard. Example: http://127.0.0.1:8080/opencrx-vcard-CRX/vcard?id=CRX/Standard/filter/allAccounts&resource=accounts.vcf
Hence, enter the following 3 lines into the field Description: url=http://127.0.0.1:8080/opencrx-vcard-CRX/vcard?id=CRX/Standard/filter/allAccounts&resource=accounts.vcf
user=guest
password=opencrx
click OK to complete the configuration of the contact folder openCRX Contacts
now it's time to give it a try - click on the toolbar button CRX.getContacts - this will initiate the download of all accounts filtered to the Account Filter allAccounts
Please note that this is (at least for the time being) a read-only adapter, i.e. changes made in Outlook won't make it back into openCRX.
While you can work with remote calendars just as you work with local calendars, there are still a few issues to keep in mind to avoid frustration:
during a download, events contained in an Outlook calendar are moved to the folder Deleted Items if they are no longer contained in the calendar on the openCRX Server (yes, the openCRX Server is the master) - note that activities can drop out of an openCRX calendar for a variety of reasons, not just because they get deleted (e.g. activities filtered to a user's homepage might drop out because they were assigned to another user)
the Outlook ICS Adapter will update existing openCRX activities during an upload, but it will create new openCRX activities only for those remote calendars that are read/write (see Calendar Selectors in the openCRX Admin Guide for more details); hence you should typically create new activities/events on the openCRX Server and not in the Outlook calendar; if you create new appointments/tasks in Outlook in a read-only remote calendar, they will be removed again during the next download (see above)
update strategy: last change wins - hence, if you are not the sole owner of a calendar (i.e. other users can create/modify/delete activities contained in your calendar), you should consider downloading an up-to-date version of the calendar just before you make any changes; and right after making your changes you should upload the calendar to make your changes persistent on the openCRX Server; otherwise you risk that your upload conflicts with changes made by another user
We have tested several third-party add-ons (e.g. RemoteCalendars, OpenConnector) and while you might get them to work it seems that most of these Outlook plugins/add-ons are somewhat intrusive and – unfortunately – none of them makes Outlook more stable (read: some of them can cause Outlook to freeze or even crash...).
Due to the lack of a satisfactory “off the rack” ICS Adapter with have put together a bunch of VBA scripts that do the job. The advantages are obvious:
the scripts are Open Source, i.e. you can even adapt/extend the scripts as you like
VBA scripts are non-intrusive, i.e. your MS Outlook will not freeze or crash (at least not more often than it already does)
reading/writing of ICS calendars happens on demand, i.e. you are in full control
and last but not least: we try to adhere to the relevant RFCs, i.e. the scripts are not openCRX-specific and they should work (maybe with minor adjustments) with other calendar servers as well
It seems that Microsoft does not really want MS Outlook users to connect to remote calendars (unless such remote calendars are sitting on an MS Exchange server, of course) because even with Redmond's flagship MS Outlook 2007 you are stuck with one of the following less than exciting options:
Published Calendars
Local calendar published to a remote location, but there is no sync with that remote calendar (i.e. changes to the remote calendar will never make it back into your Outlook calendar); one wonders how many managers it took to come up with this idea....
Internet Calendar Subscription
These calendars are strictly read-only in Outlook, i.e. about as useful as wallpaper...
It goes without saying that older versions of MS Outlook offer even less. Hence, a third-party plugin/add-on is mandatory if you intend to use MS Outlook with a third-party calendar server like openCRX. Please note that the root cause is Microsoft's unwillingness to adapt to and support open standards, and nothing else. And if Microsoft claims otherwise, please don't have the lawyers send nasty letters. Prove us wrong by adding the few lines of code required to connect MS Outlook to ICS and CalDAV servers. And if you can't do it, send us the Outlook source code and we'll add the required code for you.
Of course, you can avoid struggling with MS Outlook altogether. Get Mozilla Thunderbird with the Lightning add-on (or Sunbird if you need calendaring only) and you will be a much happier person ;-)
We don't take credit for all of the code as lots of pieces were contributed by other people. The following list is most likely not complete as some of the code snippets could not (yet) be attributed to the respective creator(s):