Load .msg email via Outlook 2007

L

Lit

Hello,

Is there an example in VB.NET or C# to load a .MSG message and extract its
attachments and body content.

I am using VS.NET 2003 and Office 2007 Beta.

Thanks so much

Lit
 
S

Sue Mosher [MVP-Outlook]

I don't think anything new in that area is in the Outlook object model. You would still use the Application.CreateItemFromTemplate method to return an unsent copy of the item, whose Body, HTMLBOdy and Attachments you can then use.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
L

Lit

Sue,

What you are saying if I have a .MSG File on Disk then I can not load it
into an Outlook object and work with it.
Can Microsoft make this available one day?

Lit


I don't think anything new in that area is in the Outlook object model. You
would still use the Application.CreateItemFromTemplate method to return an
unsent copy of the item, whose Body, HTMLBOdy and Attachments you can then
use.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

No, what I'm saying is that to meet your statement requirements -- accessing the message body and attachments -- CreateItemFromTemplate is the method in the Outlook object model that would meet those requirements.

If you have other requirements, then you should state them.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
L

Lit

Sue,

My requirements is this:

Open a .MSG File that resides on the hard disk and extract all the
attachments and body info.

So using CreateItemFromTemplate will help me do that?

..MSG Files are coming from an outside source like CDs, DVDs HDs, USB Memory
Sticks etc.

Thank you Sue for all your help


Lit



No, what I'm saying is that to meet your statement requirements -- accessing
the message body and attachments -- CreateItemFromTemplate is the method in
the Outlook object model that would meet those requirements.

If you have other requirements, then you should state them.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

Yes, why not try it and see for yourself?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
L

Lit

Sue,

You are right it works.
however When I execute blahblah.Body.ToString(), I am getting a security
alert from Outlook 2007 in a Dialog Box that said something like this: "Do
you want to allow 'someone'" to access the email body content.
I click on the <Allow> Button and everything is fine.

How to suppress that is a mystery to me.

Thanks you sooooooooooooo much for your help
U Are the best.

Lit




Yes, why not try it and see for yourself?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

See http://www.outlookcode.com/d/sec.htm for your options with regard to the "object model guard" security in Outlook 2000 SP2 and later versions.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
L

Lit

Sue,

You are MVP++, Thanks again.
The article helped me in an indirect way, I could not find the Registry Hack
needed and did not talk to the system admin yet, will figure it out in the
future.

Here is what I did for now to get by, without the Security Guard Dialog box
showing up.

Open Outlook 2007 Beta App.
Goto Outlook 2007 Tools Menu
Select Trust Center...
Click on Programmatic Access ( located on the left pane)
Select the Radio Button "Never warn me about suspicious activity ( not
recommended)) See Warning below.

Warning: Since I don't have Antivirus protection at this time on my Dev
Server, I will have it in the future, I did selected the "Never Warn me ..."
option. Always go with what is recommended which in this case the first
option "Warn me about suspicious activity when my antivirus software is
inactive or out-of-date (recommended)"


For now that is good for me while developing... I don't see the dialog box
any more.

Thanks Sue,

Lit






See http://www.outlookcode.com/d/sec.htm for your options with regard to the
"object model guard" security in Outlook 2000 SP2 and later versions.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top