none
Save Sent Folder RRS feed

  • Question

  • I'm new to Outlook c# programming and having trouble figuring out how to save a sent message to another folder.

    I have it so the user picks the folder, but can't figure out how to get the sent message to the folder.

    Thanks in advance


    Lawrence D. Wilson


    • Edited by Mozart3191 Friday, September 30, 2016 12:09 PM
    Friday, September 30, 2016 12:06 PM

Answers

All replies

  • Friday, September 30, 2016 12:14 PM
  • Thanks for the help, it work great

    Lawrence D. Wilson

    Friday, September 30, 2016 1:15 PM
  • Thanks for the help, it work great

    Lawrence D. Wilson


    You're welcome.  If your question has been answered kindly mark the answer to close the thread.
    Friday, September 30, 2016 1:47 PM
  • I have it working and was testing it on some different machines. I works most of the time, but about a quarter of the time or if I do a reply I get " The Send operation failed because the item was deleted before it was sent"

    Lawrence D. Wilson


    • Edited by Mozart3191 Friday, September 30, 2016 3:12 PM
    Friday, September 30, 2016 3:11 PM
  • I have it working and was testing it on some different machines. I works most of the time, but about a quarter of the time or if I do a reply I get " The Send operation failed because the item was deleted before it was sent"

    This seems to be a different question from how to move a Mailitem.

    I suggest you show us your code so we have a clear understanding of what you are doing.
    • Edited by RLWA32 Friday, September 30, 2016 3:36 PM
    Friday, September 30, 2016 3:33 PM
  • Hello Mozart,

    The MailItem class from the Outlook object model provides the SaveSentMessageFolder property which allows to set a Folder object that represents the folder in which a copy of the e-mail message will be saved after being sent.

    Sub SetSentFolder()  
     Dim myItem As Outlook.MailITem  
     Dim myResponse As Outlook.MailITem  
     Dim mpfInbox As Outlook.Folder  
     Dim mpf As Outlook.Folder 
     
     Set mpfInbox = Application.Session.GetDefaultFolder(olFolderInbox)  
     Set mpf = mpfInbox.Folders.Add("SaveMyPersonalItems")  
     Set myItem = Application.ActiveInspector.CurrentItem  
     Set myResponse = myItem.Reply  
     myResponse.Display  
     myResponse.To = "Eugene"  
     Set myResponse.SaveSentMessageFolder = mpf  
     myResponse.Send  
    End Sub


    [custom.development]

    Friday, September 30, 2016 4:39 PM
  • Made a copy of the email seems to working now.

    thanks


    Lawrence D. Wilson

    • Marked as answer by Mozart3191 Monday, October 3, 2016 10:49 AM
    Monday, October 3, 2016 10:48 AM