473,396 Members | 1,789 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.

Saving Message Object

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 Outlook.ApplicationClass();
Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");Outlook.MAPIFolder
oContacts = olApp.ActiveExplorer().CurrentFolder;
Object selObject = olApp.ActiveExplorer().Selection[1];
FileSystemObject fso = new Scripting.FileSystemObjectClass();
//selObject.SaveAs strFolderPath & strSaveName, olMSG

But I can't find SaveAs option in selObject property. What I am missing here.

Thanks
Kannan
Oct 10 '06 #1
2 2140
Hi,
I have changed this below code as follows

string SavedMessage = "C:\\AIA\\Message\\";
string strSaveName = "Test.msg";
Outlook._Application olApp = new Outlook.ApplicationClass();
Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");
Outlook.MAPIFolder oContacts = olApp.ActiveExplorer().CurrentFolder;
Outlook.MailItem selObject =
(Outlook.MailItem)olApp.ActiveExplorer().Selection[1];
MessageBox.Show(selObject.Subject);
//selObject.SaveAs("C:\\","Message.msg");

But when I try to call SaveAs method, it asked for one more parameter called
object Type (ie selObject.SaveAs(Path,Type)). What value I have to pass it
for Type parameter.

Please help...

thanks

"Kannan" wrote:
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 Outlook.ApplicationClass();
Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");Outlook.MAPIFolder
oContacts = olApp.ActiveExplorer().CurrentFolder;
Object selObject = olApp.ActiveExplorer().Selection[1];
FileSystemObject fso = new Scripting.FileSystemObjectClass();
//selObject.SaveAs strFolderPath & strSaveName, olMSG

But I can't find SaveAs option in selObject property. What I am missing here.

Thanks
Kannan
Oct 10 '06 #2

"Kannan" <Ka****@discussions.microsoft.comwrote in message
news:A9**********************************@microsof t.com...
| 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 Outlook.ApplicationClass();
| Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");Outlook.MAPIFolder
| oContacts = olApp.ActiveExplorer().CurrentFolder;
| Object selObject = olApp.ActiveExplorer().Selection[1];
| FileSystemObject fso = new Scripting.FileSystemObjectClass();
| //selObject.SaveAs strFolderPath & strSaveName, olMSG
|
| But I can't find SaveAs option in selObject property. What I am missing
here.
|
| Thanks
| Kannan

Sorry, I don't want to sound harsh, but you are missing a lot.
First, you need to understand the CLR's object model, so that you know that
the CLR Object class doesn't implement a SaveAs method (I hope you
understand that Object in .NET is not the same as Object in VBA).
Second, you must understand the outlook object model, so you need to start
by reading this: http://msdn2.microsoft.com/en-us/library/ms268893.aspx and
this:
http://msdn.microsoft.com/library/de...HV01136199.asp.

You must also understand that .NET comes with a rich class library, so there
is no need to use scripting objects like FileSystemObject, start by getting
used to the FCL. And I would suggest you to start with VB.NET instead of C#,
the language is better suited for this kind of tasks, especially when you
come from a scripting environment like VBA and/or VBScript.

Willy.
Oct 10 '06 #3

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

Similar topics

4
by: Jacob H | last post by:
Hello list... I'm developing an adventure game in Python (which of course is lots of fun). One of the features is the ability to save games and restore the saves later. I'm using the pickle...
4
by: Jerivix Entadi | last post by:
I'm attempting to create an application to work with a fluid database of people. I'm doing this in a command line, text-based manner. I need to know two things: 1) How do I save data, perhaps a...
3
by: cdj | last post by:
Hi all, I've got a picturebox on a form, and a save button. When I go to save, the app craps out with the following error: ================== An unhandled exception of type...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
3
by: Denis Georgievski | last post by:
I am optimizing my web application written in ASP/VB.NET 1.1. I have number of pages that have dropdown list server controls that contain large number of items. Before redesigning the data access...
4
by: John Kandell | last post by:
Hi, Would someone be able to shed some light on what is the cost of saving a DataTable to session vs saving a custom object of the same data. For example, let's say I had a DataTable with 1000...
4
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my...
6
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a...
6
by: Mark Denardo | last post by:
My question is similar to one someone posted a few months back, but I don't see any replies. Basically I want to be able to have users upload photos and save them in a database (as byte data)...
1
by: romcab | last post by:
Hi guys, I would like to ask your help about saving in ado.net. I was able to update it only on the display but when I check the database, it is not updated. I paste below my code and hopefully...
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: 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
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?
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
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
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.