Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook Object Model 10 Access to files inside Folders

Status
Not open for further replies.

Mham2k

Programmer
Jun 1, 2007
12
US
I am having a problem having my item read what is inside of a folder and tell me so I can go ahead and copy the item.
I am using vs 2003, c#

Here is my code:
Outlook.Application oApp = new Outlook.ApplicationClass();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");

Outlook.Folders oFolder = (Outlook.Folders) oNS.Folders;

Outlook.Items oItems = oFolder.Item("*****").Folders.Item("*****").Folders.Item("*****").Folders.Item("*****").Folders.Item("*****").Folders.Item("*****").Items;

for (int i=1; i <= oItems.Count; i++)
{
Console.WriteLine(oItems.Item(i).ToString());
}

Console.WriteLine("Press any key too continue...");
Console.ReadLine();

How Do you get the information about the stuff inside the folders. Here is to item(x).something that will do that. I need Help.
 
Example if the folder is Contact then you have ContactItem as items.
Code:
ContactItem myContact;
string company = myContact.ItemProperties["CompanyName"].Value
string mailaddress=myContact.ItemProperties["MailingAddressStreet"].Value
and so on.
You can add new propoerties to an Item, example:
Code:
myContact.ItemProperties.Add("MyProperty", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olNumber,true,1);
obislavu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top