Click here to Skip to main content
15,896,111 members
Home / Discussions / C#
   

C#

 
AnswerRe: auto upload/export of a downloaded CSV file to SQLSERVER on the server Pin
Nader Elshehabi10-Jul-06 23:39
Nader Elshehabi10-Jul-06 23:39 
QuestionCustom Cotrol Pin
Sashulika10-Jul-06 19:49
Sashulika10-Jul-06 19:49 
QuestionRe: Custom Cotrol Pin
Nader Elshehabi10-Jul-06 21:24
Nader Elshehabi10-Jul-06 21:24 
AnswerRe: Custom Cotrol Pin
Josh Smith11-Jul-06 4:18
Josh Smith11-Jul-06 4:18 
QuestionQuestion about string and int in c# ( IDE 2005 ) Pin
Yanshof10-Jul-06 19:10
Yanshof10-Jul-06 19:10 
AnswerRe: Question about string and int in c# ( IDE 2005 ) Pin
S. Senthil Kumar10-Jul-06 19:28
S. Senthil Kumar10-Jul-06 19:28 
AnswerRe: Question about string and int in c# ( IDE 2005 ) Pin
wasife11-Jul-06 8:30
wasife11-Jul-06 8:30 
QuestionInterop Error while including Microsoft outlook dll Pin
aaraaayen10-Jul-06 18:55
aaraaayen10-Jul-06 18:55 
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

//TO DO: If you use the Microsoft Outlook 11.0 Object Library, uncomment the following line.
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 oNS = 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;
oNS = null;
oApp = null;
}

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

// Return value.
//return 0;

}
}
}


Prya
AnswerRe: Interop Error while including Microsoft outlook dll Pin
Nader Elshehabi10-Jul-06 21:16
Nader Elshehabi10-Jul-06 21:16 
QuestionBalloon Tooltip Limitations... Pin
omgwoot10-Jul-06 13:31
omgwoot10-Jul-06 13:31 
AnswerRe: Balloon Tooltip Limitations... Pin
Nader Elshehabi10-Jul-06 21:06
Nader Elshehabi10-Jul-06 21:06 
GeneralRe: Balloon Tooltip Limitations... Pin
omgwoot10-Jul-06 22:20
omgwoot10-Jul-06 22:20 
AnswerRe: Balloon Tooltip Limitations... Pin
Nader Elshehabi10-Jul-06 23:21
Nader Elshehabi10-Jul-06 23:21 
GeneralRe: Balloon Tooltip Limitations... Pin
Robert Rohde10-Jul-06 23:47
Robert Rohde10-Jul-06 23:47 
QuestionA recursive quastion? Pin
ytubis10-Jul-06 12:45
ytubis10-Jul-06 12:45 
AnswerRe: A recursive quastion? Pin
Malcolm Smart10-Jul-06 20:50
Malcolm Smart10-Jul-06 20:50 
Questioncan't get OpenNLP model files Pin
mauraj10-Jul-06 12:25
mauraj10-Jul-06 12:25 
QuestionRunning as admin/system user on compact framework. Pin
f.vanvugt10-Jul-06 11:20
f.vanvugt10-Jul-06 11:20 
AnswerRe: Running as admin/system user on compact framework. Pin
LongRange.Shooter11-Jul-06 8:59
LongRange.Shooter11-Jul-06 8:59 
GeneralRe: Running as admin/system user on compact framework. Pin
f.vanvugt11-Jul-06 21:30
f.vanvugt11-Jul-06 21:30 
QuestionHELP! Processor at 100% Pin
Rabbit1710-Jul-06 11:19
Rabbit1710-Jul-06 11:19 
AnswerRe: HELP! Processor at 100% Pin
Not Active10-Jul-06 11:43
mentorNot Active10-Jul-06 11:43 
GeneralRe: HELP! Processor at 100% Pin
Rabbit1710-Jul-06 12:07
Rabbit1710-Jul-06 12:07 
GeneralRe: HELP! Processor at 100% Pin
Not Active10-Jul-06 12:13
mentorNot Active10-Jul-06 12:13 
GeneralRe: HELP! Processor at 100% Pin
LongRange.Shooter11-Jul-06 9:02
LongRange.Shooter11-Jul-06 9:02 

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.