DEVBUZZ Homepage Creating POOM items using PIE Web pages
 
Web www.devbuzz.com
  HOME PAGE
  All Articles
  Advertise
  Consulting

 Development
  Discuss - Forums
  Still in the box?
  .Compact Framework
  Code Snippets
  SQL Server CE
  Database
  MS Resources
 Stores
  Developer Controls
  Pocket PC Hardware
  Pocket PC Software
  Pocket PC Books
  .NET CF Books
  Book Reviews
  SPB SW Discounts
  RESCO SW Discounts
 DEVBUZZ Info
  About Us
  Help
  Join our email list
  Links & Ratings
  Press & Comments
  Pocket PC version
  Software Reviews
  Hardware Reviews
 Authors
  Authors
  Article Guide
  Competitions
 Resources
  Developers
  Register
  Login

  SPB Discounts!
 Columnists
  Rick Winscot
 Past Blast
  Personal Media Ctr
  Gizmobility
  eVB Legacy
  Old news
  Hosted Software
  Wireless
  Newsletters
  Carl Davis
  Upton Au

 Pocket PC Registry
  Join the registry
  View current list
 Current Poll
Are you converting to .NET Compact Framework?
Yes, it has changed my life!
No, I'm sticking with eVB
.NET CF what's that`?

Current results
3431 votes so far
 Recent Forum Threads [goto forums]

Get Computername
read... (67 hits)


Great aid to development productivity
read... (82 hits)


ThreadingTimer sample code
read... (143 hits)


Multithreading with .NET CF
read... (194 hits)


Moving from eMbedded Visual Basic to Visual Basic .NET
read... (166 hits)


.NET Compact Framework 2.0 Service Pack 2
read... (226 hits)


Transfer Data from SQL Server 2000 to SQL Server Compact Edition
read... (298 hits)


This protocol version is not supported
read... (236 hits)


Converting Lowercase to uppercase wont work
read... (203 hits)


Direct access to MS SQL Server 2000
read... (374 hits)


Creating SDF file in Desktop
read... (513 hits)


Winsock in CF.NET
read... (316 hits)


Using Pocket Outlook to submit HTML page form with MAILTO action
read... (420 hits)


Missing file "System.Data.PocketPC.asmmeta.dll"
read... (268 hits)


HP iPAQ hw6915 Serial Port Issue
read... (309 hits)


Info on the recent forum changes
read... (341 hits)


SqlServer tools from Redgate
read... (383 hits)


Arrow keys and Hardware navigation button
read... (393 hits)


O2 XDA lls pin sync cable to comport
read... (322 hits)


Creating dynamic folders on Pocket PC OS
read... (299 hits)

Custom Windows Mobile software development.
LBS Challenge 2007
LBS Challenge Eight previous NAVTEQ Global LBS Challenge® participants have received venture capital funding and nine past LBS Challenge winners have launched commercial applications on major wireless carriers. Register your non-commercial LBS application in the 2007 NAVTEQ Global LBS Challenge in one of three regions: Americas, Europe-Middle East-Africa (EMEA) or Asia-Pacific(APAC). You could win a share of $2 million in prizes. This could be your year.
Dream. Develop. Win.

Development | Starting Out

Creating POOM items using PIE Web pages
Written by John Cody  [author's bio]  [read 36214 times]
Edited by Derek

Discuss this article   eVB Ver 3.0   

Page 1  Page 2 

Creating POOM items using PIE Web pages

The ability to manipule Pocket Outlook items such as Contacts, Appointments and Tasks from an eVB app is a very cool feature. Once the various items are added into the outlook database, your app could filter and display those items based on the user's preferences, or allow the user to quickly find a specific item. However, the process of creating a new outlook item is usually a manual process. The user typically selects "New" and then tediously enters the various text data of the item using the very small SIP keyboard or by writing on the screen. This is not only a time consuming task, but it is prone to errors.

A "Contact" item is particularly time consuming to enter. You typically end up entering a company name, first and last name, telephone number and an email address before saving it.

Wouldn't it be nice to have all of a contacts' data automatically entered into your Pocket PC simply by clicking on a link of a webpage? Well, that's exactly what I am about to show you how to do.

I could have designed an eVB app to accomplish this, but it would require each user to first install the eVB app on their Pocket PC before they can start adding contacts. This method would also has the disadvantage of requiring the user to install continuous program updates on their Pocket PC to facilitate new features or fix bugs with an existing version.

The method I chose does not require any special software to be installed on the user's Pocket PC, so virtually any Pocket PC can immediately utilize my technique to add new contacts right out of the box. In addition, new features and capabilities can be easily added without a single change to the user's Pocket PC.

The key to my technique is PIE's support of JavaScript. Even though I have never programmed in JavaScript before, it was not too difficult to understand because of a few key similarities it has with Basic.

Let's now dive into the details of my technique…

Because JavaScript is a scripting language, it has many of the same capabilities as VBScript, including the key ability to reference ActiveX Objects. Luckily, the ActiveX control 'PIMSTORE.DLL' is included in every Pocket PC's ROM. This was a critical factor in allowing Pocket PC's to use my technique out-of-the-box (without installing any special software).

NOTES:

1) A download which includes more info and example code for using POOM can be found at:
http://www.microsoft.com/mobile/developer/downloads/poomsdk.asp

2) The code below was reported to work on first-generation Casio, HP and iPaq Pocket PC's. However, it appears not to work on the newer Pocket PC's 2002. I am waiting for the PC 2002 upgrade for my test 3135 mono iPaq so I can find out what's happening. It is probably something simply like a slight syntax change such as removing the "()" after calls such as "pol.logon" - which desktop IE requires to work.

The first step in creating a new pocket outlook Contact item, is to create an instance of the Pocket Outlook Object Module (POOM). This is accomplished from within JavaScript as shown below:

var pol;
pol = new ActiveXObject("pocketoutlook.application");

Next, we need to log into the Pocket Outlook Datastore:

pol.logon();

Then, we simply create a reference to a new Contact item:

contact = pol.createitem(2);

Set the various fields of the new contact item:

contact.CompanyName = "deVBuzz.com";
contact.Email1Address = "derek@devbuzz.com";
contact.FirstName = "Derek";
contact.LastName = "Mitchell";
contact.webpage = "http://www.devbuzz.com/pie";
contact.body = "deVBuzz.com is dedicated to …";

Save it and log off:

contact.save();
pol.logoff();

The lines of code above represent the raw code of my technique. But to be truly useful, it needs to reside in a web page/HTML file. Below is a complete HTML file incorporating my technique and even a little extra code to check to see if the contact already exists in the user's database, so it won't add a duplicate entry.

<head><title>Poom Test</title></head>
<body topmargin="0">
&nbsp;<p align="center"><b>Creating Outlook Items via<br>Pocket Internet Explorer<br>
Webpages</b></p>
<p align="center">&nbsp;</p>
<p align="center">By John Cody<br>and deVBuzz.com&nbsp;</p><hr>

<p align="center"><font size="3"><a href="#" onclick="addcontact()"><br>Click Here<br>

</a>To add <b>deVBuzz.com<br>
</b>to your Contact list.
</font></p></body>

Next Page 

Back to Starting Out | [Article Index]

 

Back to the top of the page.
Chris De Herrera's Windows CE Website Windows CE News & Information Source
Copyright ©2000-2007 by DEVBUZZ.COM, Inc., NJ. USA.MSDEVELOP