473,396 Members | 2,098 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,396 software developers and data experts.

Save MAPI.Message as File

Hi,

This is the first time I've posted something on here.
I've looked around the web for hours and failed miserably. Hopefully
someone out there would be able to help.
I'm trying to save an MApi.Message (which represents an email) object
to my hard or a network drive drive as an MSG file but I'm getting
nowhere. I know I
can use Redemption to do this but I'm trying to avoid 3rd party
products (especially ones I have to pay for)

Here's my code

------------------------------------

MAPI.Session oSession = new MAPI.Session();
MAPI.Folder oFolder;
MAPI.Messages oMessages;
MAPI.Message oMessage;
string strEmailAccount = "Exchange_Email_Account";
string strExchangeServerName = "exchange04";
object profile = null;
string strProfile = strExchangeServerName + Constants.vbLf +
strEmailAccount;
oSession.Logon("", , , false, , true, strProfile);
oFolder = oSession.Inbox;
oMessages = oFolder.Messages;
oMessage = oMessages.Item(2);

----------------------------------------------

Your help will be appreciated!

Thanks
Jun 27 '08 #1
3 3409
On Fri, 18 Apr 2008 01:30:30 -0700, Nabil <ny*****@gmail.comwrote:
[...]
I'm trying to save an MApi.Message (which represents an email) object
to my hard or a network drive drive as an MSG file but I'm getting
nowhere.
Sorry to say, I'm not sure this newsgroup is going to be a great place to
get your answer. If the MAPI.Message object includes some sort of
"Save()" method that automatically writes the file format you're looking
for, then that's obviously the way to go. However, I have to assume that
since you're posting here you've already verified no such method exists (I
certainly don't know myself one way or the other).

I suppose it's possible that the MAPI namespace itself includes some class
with a static method that could do the job, but that seems like more of a
long shot, and in any case again...it seems unlikely that the expertise
for knowing the answer off the top of one's head probably doesn't exist in
this newsgroup.

Barring that, you're probably going to have to figure out the MSG file
format yourself, extract the data from the Message object, and write out
the message file yourself. But again, not much help would exist in this
newsgroup for that.

Basically, your question has practically nothing at all to do with C# (the
nominal topic of this newsgroup), and relatively little to do with .NET
(technically off-topic, but de facto within the scope of the newsgroup).
You really need to find a forum specifically targeted at the interop API
for messaging, or maybe even Office (I realize it's not Office per se, but
the MSG format I think is, and in any case you're much more likely to run
across people with experience in this area in such a forum).

And no, I don't know off-hand where those forums are. But surely they are
out there. :)

Sorry for not being more helpful.

Pete
Jun 27 '08 #2
Thanks a lot for taking the time to reply.

There's no Save() method in Mapi.Message but I will double check the
MAPI namespace. I'll also look for a group that specifically
addresses MAPI.

Cheers

Nabil
Jun 27 '08 #3
thd
On Mon, 21 Apr 2008 01:15:32 -0700, Nabil wrote:
Thanks a lot for taking the time to reply.

There's no Save() method in Mapi.Message but I will double check the
MAPI namespace. I'll also look for a group that specifically addresses
MAPI.

Cheers

Nabil
I recommend microsoft.public.win32.programmer.messaging

Tom Delany
Jun 27 '08 #4

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

Similar topics

14
by: Chris | last post by:
I'm trying to send an e-mail through outlook. So far I've gotten it to work with the mail script at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/149461 My only problem is that when I...
1
by: V.C.Sekhar | last post by:
Hi there, Can any one please help in getting me Python-Outlook programming issue clarified. I just wanted to do the following using Python: 1)Open a New Oulook Mail Window
2
by: Larry Eaton | last post by:
According to MSDN there is MAPI example code in a file SIMPLE.CLI I cannot locate this file. Can anyone direct me to the location of this? It doesn't appear to be anywhere in...
3
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and...
0
by: jackiewkc | last post by:
Hi, Does anyone know how to use VB to write a simple MAPI to save email attachments from a specified email address to my hard drive? What I basically want is that everytime when I receive an...
1
by: bobh | last post by:
Hi All, I've been using this function which I got from here for some time now in two of my AccessXP multiusers applications and it has worked without issue until lately it has stopped functioning...
3
by: Nabil | last post by:
Hi, This is the first time I've posted something on here. I've looked around the web for hours and failed miserably. Hopefully someone out there would be able to help. I'm trying to...
1
by: Nabil | last post by:
Hi, This is the first time I've posted something on here. I've looked around the web for hours and failed miserably. Hopefully someone out there would be able to help. I'm trying to save...
15
by: squrel | last post by:
Hi everyone.. i need ur help once more time.... i have a form called reminder..in tht form i have: txtid, txtcaseid, txtreminder, cmbremindby(system or user), txtremindto, dtpreminddt,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.