473,835 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Outlook Program

Dan
I need to access a user's inbox and extract attachments off of new messages.
I have connected up to my Inbox and can see my messages, but I need to
navigate to another user's inbox. Any help would be appreciated. Here's some
of the code I'm using:

// Get items in my inbox.
Application outLookApp = new Application();
NameSpace outlookNS = outLookApp.GetN amespace("MAPI" );
MAPIFolder inboxFolder =
outlookNS.GetDe faultFolder(OlD efaultFolders.o lFolderInbox);

// Print out basic info.
Console.WriteLi ne("You have {0} e-mails.", inboxFolder.Ite ms.Count);
Console.WriteLi ne();
foreach (object obj in inboxFolder.Ite ms)
{
MailItem item = obj as MailItem;
if (item != null)
{
Console.WriteLi ne("-Received: {0}", item.ReceivedTi me.ToString());
Console.WriteLi ne("-Sender: {0}", item.SenderName );
Console.WriteLi ne("NBR ATTACHMENTS: {0}", item.Attachment s.Count);
Console.WriteLi ne();
Console.ReadLin e();
}
}
Oct 2 '06 #1
0 1004

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

Similar topics

9
3096
by: George McCullen | last post by:
I have an Outlook 2003 using Exchange Server 2003 Public Contacts Folder containing 20,000 Contacts. I am writing a VB .Net 2003 program that loops through all the contacts in a "for each oCt in oItems" loop. After about 250 contacts, the program gives an InvalidCastException Error on the for each loop. I notice that Outlook's memory keeps increasing (using the task manager) until it reaches around 20,000K. When I run the program a second...
3
8695
by: Paul | last post by:
Hello, I am trying to set up a program that will email me when a process has been completed by a user. The user uses a program that moves some files, after these files are moved I want the program to also send an email that the process has been completed. The PC's are set up to use outlook profiles. When a user logs into our 2000 domain server through that machine, and they open outlook they are presented with a box to chose the...
3
5468
by: Chris Thunell | last post by:
I am using vb.net to access a public folder in Outlook / Exchange Server. Whenever my program tries to access this folder i get a dialogue box saying "A Program is trying to access Outlook. Do you want to allow access" with Yes/No buttons and if Yes, then to allow access| for specified period in minutes. This is precluding me from truling automating this process because i have to be here to click the appropriate buttons. Any way to...
3
2867
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and additionally pictures of the product are stored in an images subfolder and the database holds the file name of the relevant picture. The user can then click a button to display the picture in a pop-up window and also another button to email the potential...
5
3047
by: John A. Bailo | last post by:
I have a program that I'm converting from Outlook 2000 to Outlook 2003. It basically opens Outlook and iterates through a series of items in a public folder. I was able to run this as a scheduled task overnight. But now, it seems to want to have me be logged in already or it will not log into Outlook.
3
1722
by: tshad | last post by:
I have a program that is reading one of my mailboxes. It is polling the mailboxes ever 5 minutes to see if there is a message or not. Is this how Outlook does it (using Exchange as the server)? It doesn't seem to. When a message gets to Exchange, it seems to do some type of Push to Outlook as Outlook has it immediately. If so, ss there a way to make my program do that in VS. We are getting
3
2974
by: Chet | last post by:
I am writing an application that utilizes a reference to Microsoft Outlook. (Added a reference to the MS Outlook COM interface to my project). I then write code such as: dim olApp as new Outlook.Applicaiton dim olNamespace as OutlOok.Namespace = olApp..... I am deploying my application via the "publish" feature that makes it downloadable and installable via the web.
5
2425
by: fniles | last post by:
I am using VB.NET 2005. I created a project using the Microsoft Outlook 8.0 Object Library (Object Model) in my previous machine. Now that I have a new machine, when I try to compile that program in the new machine, it gives me erros like "Type 'Outlook.Application' is not defined", "Type 'Outlook.NameSpace' is not defined". I have MS Outlook in my new machine. In the new machine when I go to "Add Reference", select the COM tab, the only...
2
2061
by: Ryan H | last post by:
I made a program that reads emails from an Outlook mailbox and does some stuff and the program works fine. However, my boss now tells me that the program is to be executed from a remote computer. I now get the following error when calling the program remotely: "Could not complete the operation because the service provider does not support it. at Outlook.NameSpaceClass.get_Folders() For more information, see Help and Support Center at...
4
5163
by: musicloverlch | last post by:
Hi all, I have a database being used by 30 people and is split between the backend and frontend. The database has the ability to send e-mails through Outlook and I have even put Redemption on people's PCs as to not get all the Outlook security prompts. Here's the problem: Half are using Outlook 2003, the other half is using Outlook 2007, and 1 is using Outlook XP. I am using Outlook 2007, so my reference is set to use Microsoft...
0
9810
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9653
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10562
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10236
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5805
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4434
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3997
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3092
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.