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