![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I want to add a MailItem directly to the Sent Items folder. I don't
want to actually 'send' the email. The purpose of adding the email to the Sent Items folder is just to show that it was actually sent at some point. The email was in fact already sent by another application previously. Here is the code I have tried to use, the problem I am having is that the MailItem will only make it to the Drafts folder. Microsoft.Office.Interop.Outlook.MAPIFolder outBoxfolder = _MAPINamespace.GetDefaultFolder(Microsoft.Office.I nterop.Outlook.OlDefaultFolders.olFolderSentMail); Microsoft.Office.Interop.Outlook.MailItem mailItem = (Microsoft.Office.Interop.Outlook.MailItem)outBoxf older.Items.Add(Microsoft.Office.Interop.Outlook.O lItemType.olMailItem); mailItem.Body = "test"; mailItem.To = "; mailItem.Subject = "subject"; mailItem.Save(); mailItem.Close(OlInspectorClose.olSave); |
Ads |
#2
|
|||
|
|||
![]()
This type of question can best be answered by those who are more experienced with programming in Outlook,
You may want to post this in the microsoft.public.outlook.program_forms group for Outlook 98 or in the microsoft.public.outlook.program_vba group for Outlook 2000. You will probably receive a faster and more expert answer over there. -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, Omatase asked: | I want to add a MailItem directly to the Sent Items folder. I don't | want to actually 'send' the email. The purpose of adding the email to | the Sent Items folder is just to show that it was actually sent at | some point. The email was in fact already sent by another application | previously. | | Here is the code I have tried to use, the problem I am having is that | the MailItem will only make it to the Drafts folder. | | Microsoft.Office.Interop.Outlook.MAPIFolder outBoxfolder = | _MAPINamespace.GetDefaultFolder(Microsoft.Office.I nterop.Outlook.OlDefaultFolders.olFolderSentMail); | | Microsoft.Office.Interop.Outlook.MailItem mailItem = | (Microsoft.Office.Interop.Outlook.MailItem)outBoxf older.Items.Add(Microsoft.Office.Interop.Outlook.O lItemType.olMailItem); | | mailItem.Body = "test"; | mailItem.To = "; | mailItem.Subject = "subject"; | | mailItem.Save(); | | mailItem.Close(OlInspectorClose.olSave); |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why does the Address property of the Recipient object in the Outlook object model look funny? | Omatase | Outlook - General Queries | 2 | July 13th 07 09:09 PM |
Outlook Object Model Threading | MON205 | Outlook - General Queries | 8 | May 6th 07 04:37 PM |
Outlook Object Model Threading | MON205 | Add-ins for Outlook | 8 | May 6th 07 04:37 PM |
Outlook object model guard | Mark Priem | Outlook and VBA | 7 | January 3rd 07 06:41 PM |
How to redistribute Outlook Object Model? | papachina | Outlook and VBA | 5 | September 11th 06 07:14 PM |