views:

395

answers:

1

Hello,

I'm looking for a code snippet that can delete all emails and text messages on a Windows Mobile device. Preferably the code would delete items in the Sent and Drafts folders as well as the Inbox.

My platform is Windows Mobile (5.0 SDK) and .net 2.0 compact framework (C# / VB.NET)

Many thanks

+1  A: 

Unfortunately Microsoft has not made this easy for managed developers. Why the WindowsMobile.PocketOutlook class wrappers don't provide this functionality one can only guess. What you have to do is write your own COM interop object to MAPI. Sorry, I don't have one to give you as a sample, but I can at least give you pointers to the methods you'll be interested in:

InTheHand has a wrapper that has additional methods for POOM, but I've never used it and I don't know if it has anything that does what you need. Might be worth a look, though, before embarking on rolling this yourself.

ctacke