"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.