Skip to main content

Past Blast

Featured Products

Windows Mobile Developer Controls
Windows Mobile Developer Controls
Stay in touch using the DEVBUSS RSS feeds.
 

News

Windows Mobile Developer Controls
Sapphire Soltuions

Use eVB (eMbedded Visual Basic) to access the Pocket Outlook Object Model (POOM) on your Pocket PC.

Written by Derek Mitchell  [author's bio]  [read 60391 times]
Edited by Derek

Download the code

Page 1  Page 2  Page 3 

I suspect that for many VB programmers one of the most compelling reasons for buying a Pocket PC is that you could put your VB knowledge to work and access the data on your handheld using eVB. If you have ever owned that 'other handheld' and written any apps for it you will be excused for thinking that handheld development is not a walk in the park. Fortunately we have our Pocket PC's and eVB to dispell this belief and we continue to do this with impunity as we tackle the task of accessing the Pocket Outlook.

Tutorial Goal
If you have scripting experience with any of the Microsft object model's this tutorial will enable you to get started with accessing the Pocket Outlook data using eVB. The rest of it will probably be intuitive enough for you to work it out.

What you need to get started

  • The Visual Tools installed with eMbedded Visual Basic
  • Although not the most user friendly document you can download the POOM SDK from Microsoft. I used the 'pocket outlook object model.doc' document to write this article. DO NOT follow the 'readme.txt' in the SDK - if you have a Pocket PC you do not need to install the pimstore.dll!
  • Your Pocket PC needs to be docked since you cannot access the POOM in emulation (actually you can - but it only supports the City Folder since that's in ROM)
  • Some form of beverage; beer, coffee, tea whatever your toxin of choice, but drink fast because there really isn't much to this.

The Pocket Outlook Object Model (POOM)

POOM constants (popup)
POOM constants (right click and save to download text)

Very simply you access the Pocket Outlook data using the folder/items paradigm. The Contact, Calendar, Task are exposed as folders which contain a collection of items. Each item supports properties specific to their type. The really functional folders from a POOM perspective are the first three; the Contact, Calendar and Task folders. The last two are different in that the City folder can only be read; you can't manipulate the items collection; and the Infrared folder does not implement the items collection as the other folders do since it's primary purpose is to receive items or folders for infrared transmission. A subject for a later date.

The Application Object

The Application Object is the gateway to this object model and you have a create an instance of this object to access the folder list. You can't directly instantiate any of the items exept thougth the Application object. It has some interesting properties:

Version: shows the current version of the Object Model
HomeCity: The current home city
VisitingCity: The current visiting city
CurrentCity Index: Returns a constant indicating whether the Home or VisitingCity is the current
OutlookCompatible: Evidently the Task items behave somewhat differently depending on whether your handheld is partnered with Outlook or Schedule+. This property allows you to cater for those differences by returning a boolean indicating compatibility with Outlook.

To access these properties you would use code something like:

Private Sub Info()
Dim Success
Dim strDisp
  Set appPO = CreateObject("PocketOutlook.Application")
  Success = appPO.Logon
  strDisp = "Version: " & appPO.Version & vbCrLf & _
    "OutlookCompatible: " & appPO.OutlookCompatible
  MsgBox strDisp, vbOKOnly
  appPO.Logoff
  Set appPO = Nothing
End Sub

The eVB Project

This example project will show you how to read data from the Contacts, Calendar, Tasks and City folders. We will create a drop down combo-box with the folder types and configure it to fire a sub-routine to load the appropriate data into a listbox. This example should provide you with enough familiarity to extend the fuctionality for your specific applications. Simple! Lets build the project and then we will walk though the POOM related code. But first some coffee!

Create a new eVB project. In my case it is a Pocket PC project since I'm a iPAQ toting geek.

Drag two labels, a text box, combo-box and listbox onto the form.

Next Page