J
Jochen Stuempfig
Hello
i try to create an Outlook Mailitem using the Microsoft Outlook Library 9.0
for Outlook 2000.
My Code looks like this:
Outlook.Application oApp = new Outlook.Application();
Outlook._NameSpace oNameSpace = oApp.GetNamespace("MAPI");
oNameSpace.Logon(null, null, true, true);
Outlook.MAPIFolder oOutboxFolder =
oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox);
Outlook._MailItem oMailItem =
(Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
oMailItem.SaveSentMessageFolder = oOutboxFolder;
oMailItem.Save();
In the line where i try to create an new Mailitem i get an
InvalidCastException. Can anybody help me with this problem.
greets jochen
i try to create an Outlook Mailitem using the Microsoft Outlook Library 9.0
for Outlook 2000.
My Code looks like this:
Outlook.Application oApp = new Outlook.Application();
Outlook._NameSpace oNameSpace = oApp.GetNamespace("MAPI");
oNameSpace.Logon(null, null, true, true);
Outlook.MAPIFolder oOutboxFolder =
oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox);
Outlook._MailItem oMailItem =
(Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
oMailItem.SaveSentMessageFolder = oOutboxFolder;
oMailItem.Save();
In the line where i try to create an new Mailitem i get an
InvalidCastException. Can anybody help me with this problem.
greets jochen