Click here to Skip to main content
15,907,687 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Screen Capture Pin
Jeeva Mary Varghese11-Jul-06 0:21
Jeeva Mary Varghese11-Jul-06 0:21 
AnswerRe: Screen Capture Pin
Guffa11-Jul-06 9:41
Guffa11-Jul-06 9:41 
GeneralRe: Screen Capture Pin
Jeeva Mary Varghese11-Jul-06 23:16
Jeeva Mary Varghese11-Jul-06 23:16 
QuestionInsert command Pin
kirthikirthi10-Jul-06 20:42
kirthikirthi10-Jul-06 20:42 
AnswerRe: Insert command Pin
Guffa10-Jul-06 23:39
Guffa10-Jul-06 23:39 
GeneralRe: Insert command Pin
kirthikirthi11-Jul-06 0:48
kirthikirthi11-Jul-06 0:48 
GeneralRe: Insert command Pin
eggsovereasy11-Jul-06 9:01
eggsovereasy11-Jul-06 9:01 
QuestionInterop Error while including Microsoft outlook dll in dot net 2005 Pin
aaraaayen10-Jul-06 20:36
aaraaayen10-Jul-06 20:36 
I am adding reference for microsoft outlook. i have selecting microsoft outlook 11.0 object library.

but in my code it gives error in c#.net 2005. but its working in visual studio 2003. Please help me.

Error:

The type or namespace name 'Interop' does not exist in the namespace 'Microsoft.Office' (are you missing an assembly reference?)

using System;
using System.Collections.Generic;
using System.Text;
//using System;
using System.Reflection; // to use Missing.Value


using Outlook = Microsoft.Office.Interop.Outlook;


namespace CheckOutlook
{
class Program
{
static void Main(string[] args)
{
try
{
// Create the Outlook application.
// in-line initialization
Outlook.Application oApp = new Outlook.Application();

// Get the MAPI namespace.
Outlook.NameSpace removed = oApp.GetNamespace("mapi");

// Log on by using the default profile or existing session (no dialog box).
oNS.Logon(Missing.Value, Missing.Value, false, true);

// Alternate logon method that uses a specific profile name.
// TODO: If you use this logon method, specify the correct profile name
// and comment the previous Logon line.
//oNS.Logon("profilename",Missing.Value,false,true);

//Get the Inbox folder.
Outlook.MAPIFolder oInbox = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);

//Get the Items collection in the Inbox folder.
Outlook.Items oItems = oInbox.Items;

// Get the first message.
// Because the Items folder may contain different item types,
// use explicit typecasting with the assignment.
Outlook.MailItem oMsg = (Outlook.MailItem)oItems.GetFirst();

//Output some common properties.
Console.WriteLine(oMsg.Subject);
Console.WriteLine(oMsg.SenderName);
Console.WriteLine(oMsg.ReceivedTime);
Console.WriteLine(oMsg.Body);

//Check for attachments.
int AttachCnt = oMsg.Attachments.Count;
Console.WriteLine("Attachments: " + AttachCnt.ToString());

//TO DO: If you use the Microsoft Outlook 10.0 Object Library, uncomment the following lines.
/*if (AttachCnt > 0)
{
for (int i = 1; i <= AttachCnt; i++)
Console.WriteLine(i.ToString() + "-" + oMsg.Attachments.Item(i).DisplayName);
}*/

//TO DO: If you use the Microsoft Outlook 11.0 Object Library, uncomment the following lines.
/*if (AttachCnt > 0)
{
for (int i = 1; i <= AttachCnt; i++)
Console.WriteLine(i.ToString() + "-" + oMsg.Attachments[i].DisplayName);
}*/


//Display the message.
oMsg.Display(true); //modal

//Log off.
oNS.Logoff();

//Explicitly release objects.
oMsg = null;
oItems = null;
oInbox = null;
removed = null;
oApp = null;
}

//Error handler.
catch (Exception e)
{
Console.WriteLine("{0} Exception caught: ", e);
}

// Return value.
//return 0;

}
}
}


Prya
Questionauto upload/export of a downloaded CSV file to SQLSERVER on the server Pin
amitcoder8310-Jul-06 19:55
amitcoder8310-Jul-06 19:55 
AnswerRe: auto upload/export of a downloaded CSV file to SQLSERVER on the server Pin
Saifi Hasan11-Jul-06 2:51
Saifi Hasan11-Jul-06 2:51 
Questionsave image in database and show all images in control from database [modified] Pin
srinandan..10-Jul-06 19:52
srinandan..10-Jul-06 19:52 
AnswerRe: save image in database and show all images in control from database Pin
Paul Conrad25-Jul-06 9:23
professionalPaul Conrad25-Jul-06 9:23 
QuestionInsert comment in Excel sheet with Asp.net Pin
mhemant10-Jul-06 19:50
mhemant10-Jul-06 19:50 
QuestionDesign Question Pin
smarttom9910-Jul-06 18:25
smarttom9910-Jul-06 18:25 
AnswerRe: Design Question Pin
Paddy Boyd10-Jul-06 22:09
Paddy Boyd10-Jul-06 22:09 
QuestionWEBSITE MONITORING:REQUEST:URGENT PLZZZZZZ Pin
Devi C10-Jul-06 18:03
Devi C10-Jul-06 18:03 
QuestionVCalendar in C# Pin
B Desai10-Jul-06 12:59
B Desai10-Jul-06 12:59 
QuestionUnmangle DLL name in DotNetNuke Pin
wildfiction10-Jul-06 11:29
wildfiction10-Jul-06 11:29 
Question3D Dynamic Virtual Tour Pin
DaViL8310-Jul-06 9:37
DaViL8310-Jul-06 9:37 
AnswerRe: 3D Dynamic Virtual Tour Pin
DaViL8311-Jul-06 2:47
DaViL8311-Jul-06 2:47 
QuestionDrop down list not populating [modified] Pin
leckey10-Jul-06 9:35
leckey10-Jul-06 9:35 
AnswerRe: Drop down list not populating Pin
Not Active10-Jul-06 11:51
mentorNot Active10-Jul-06 11:51 
AnswerRe: Drop down list not populating Pin
postmaster@programmingknowledge.com10-Jul-06 17:47
postmaster@programmingknowledge.com10-Jul-06 17:47 
QuestionUse of query strings Pin
leckey10-Jul-06 5:55
leckey10-Jul-06 5:55 
AnswerRe: Use of query strings Pin
Paddy Boyd10-Jul-06 6:06
Paddy Boyd10-Jul-06 6:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.