473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

saving Oulook.MailItem objects

hello everyone.

My problem is as follows :

my application keeps a hashtable with Outlook.MailItem objects.
I need to save and load this hashtable (with those objects inside) when
starting and terminating the
application.

I can't "serialize" them because Outlook.MailItem objects do not implement
the Iserializable interface.

so how do I go about saving and loading the hastable with the objects ??
(or even just tell me how to access the binary stream that compose each
Outlook.MailItem object)
I'm stuck with this problem for almost 3 days without any lead ... PLEASE
HELP !!!

Thanks alot
Inon
Nov 13 '05 #1
1 6463
Inon,

The MailItem object is a COM object. You will want to import one of the
following interfaces into your application first:

IPersistFile
IPersistMemory
IPersistStream

These are COM interfaces that are used for persistence. If the MailItem
class implements one of these interfaces, then you can get the bytes from
the file, memory location, or stream (by calling Save on any of those
interface), and then store that byte array in your serialization stream
through custom serialization (create a wrapper for the MailItem class which
will serialize it correctly, exposing the MailItem through a property and
insert those into your hash table).

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Inon Zukerman" <in*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
hello everyone.

My problem is as follows :

my application keeps a hashtable with Outlook.MailItem objects.
I need to save and load this hashtable (with those objects inside) when
starting and terminating the
application.

I can't "serialize" them because Outlook.MailItem objects do not implement
the Iserializable interface.

so how do I go about saving and loading the hastable with the objects ??
(or even just tell me how to access the binary stream that compose each
Outlook.MailItem object)
I'm stuck with this problem for almost 3 days without any lead ... PLEASE
HELP !!!

Thanks alot
Inon

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Karsten Schramm | last post by:
Hi, if I drag an Outlook.MailItem to a Windows-Explorer window a <subject>.msg file will be created. Now I try to drag & drop a mail item to my own WinForm app. Unfortunately it doesn't work....
2
by: Bora | last post by:
Is there a resource that discusses how C++ objects are saved to and loaded from files? Sorry if this is not a strictly C++ issue. In particular, I am looking for information about maintaining...
0
by: Krishna | last post by:
I am trying to loop thru Inbox and select any one email and save it as a RTF file. Here is the code I am using Outlook.Explorer myOutlookExplorer =...
3
by: Sidney | last post by:
How to make the system sending a job to MS Oulook by using VB.NET programming? thanks a lot~ Sidney
2
by: Kannan | last post by:
Hi, I am trying to save Inbox selected message in C: I have used following code string SavedMessage = "C:\\AIA\\Message\\"; string strSaveName = "Test.msg"; Outlook._Application olApp = new...
1
by: The Night Blogger | last post by:
Is there a way to pull & push data (Tasks, Notes, Calendar Items ...) into Microsoft Oulook from Python ?
0
by: Surmaj | last post by:
Hi I have a problem while saving the attachments of the outlook express mails in a local file. I am doing the following tasks. foreach (Object obj in inboxFolder.Items) ...
6
mageswar005
by: mageswar005 | last post by:
Hi, Can anybody knows, How can i retrive oulook express mail using php.Its possible.please help me guys its urgent. Regards, M.Mageswaran
16
by: Wayne | last post by:
I've read that one method of repairing a misbehaving database is to save all database objects as text and then rebuild them from the text files. I've used the following code posted by Lyle...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.