D
Dave
The following C# code returns the error:
The name 'olFolderContacts' does not exist in the class or namespace
'OutlookSyncConsole.Class1'
I have a reference set to the Outlook 11 type library in my C# project.
Can anyone tell me how to reference the default folder in C#?
Thanks
Dave
-------------------------------------------
static void Main(string[] args)
{
Console.WriteLine("Outlook");
Outlook.Application ola = new Outlook.Application();
Outlook.NameSpace ns;
Outlook.MAPIFolder mf;
Outlook.ContactItem ci;
Outlook.Items i;
Outlook.UserProperty up;
ns=ola.GetNamespace("MAPI");
mf=ns.GetDefaultFolder(olFolderContacts); //ERROR occurs here
up=null;
i=null;
ci=null;
mf=null;
ns=null;
ola=null;
}
The name 'olFolderContacts' does not exist in the class or namespace
'OutlookSyncConsole.Class1'
I have a reference set to the Outlook 11 type library in my C# project.
Can anyone tell me how to reference the default folder in C#?
Thanks
Dave
-------------------------------------------
static void Main(string[] args)
{
Console.WriteLine("Outlook");
Outlook.Application ola = new Outlook.Application();
Outlook.NameSpace ns;
Outlook.MAPIFolder mf;
Outlook.ContactItem ci;
Outlook.Items i;
Outlook.UserProperty up;
ns=ola.GetNamespace("MAPI");
mf=ns.GetDefaultFolder(olFolderContacts); //ERROR occurs here
up=null;
i=null;
ci=null;
mf=null;
ns=null;
ola=null;
}