none
While Sending a mail from Outlook i want to save it to the specific folder??? RRS feed

  • Question

  • I want to prompt the user while sending mail where he want to save the sending mail with attachment.

    How could i do that?

    Should i have to get a reference to Send Event and then use it for my action,

    If any 1 have a code snippet please let me know!! I like this task, let us solve it

    Monday, September 24, 2012 5:16 AM

Answers

  • Handle the Send() event on the item, prompt the user in the event handler using a PickFolder() dialog to have them select the folder, then use that folder to set the SaveSentMessageFolder property on the item. That will save it to that folder when the item has been sent.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "nirajzambad" <=?utf-8?B?bmlyYWp6YW1iYWQ=?=> wrote in message news:a6ece787-daf2-44bb-a509-86d64cf7bcf3...

    I want to prompt the user while sending mail where he want to save the sending mail with attachment.

    How could i do that?

    Should i have to get a reference to Send Event and then use it for my action,

    If any 1 have a code snippet please let me know!! I like this task, let us solve it


    Ken Slovak MVP - Outlook
    Monday, September 24, 2012 3:41 PM
    Moderator
  • Your form should be blocking -  use ShowDialog.
    (If you use Show, the form will be displayed, but the code that called it will continue running)

    Tuesday, September 25, 2012 8:21 AM
  • Tuesday, September 25, 2012 11:49 AM

All replies

  • Handle the Send() event on the item, prompt the user in the event handler using a PickFolder() dialog to have them select the folder, then use that folder to set the SaveSentMessageFolder property on the item. That will save it to that folder when the item has been sent.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "nirajzambad" <=?utf-8?B?bmlyYWp6YW1iYWQ=?=> wrote in message news:a6ece787-daf2-44bb-a509-86d64cf7bcf3...

    I want to prompt the user while sending mail where he want to save the sending mail with attachment.

    How could i do that?

    Should i have to get a reference to Send Event and then use it for my action,

    If any 1 have a code snippet please let me know!! I like this task, let us solve it


    Ken Slovak MVP - Outlook
    Monday, September 24, 2012 3:41 PM
    Moderator
  • i override the Application_ItemSend method. I customized the event as to show me the windows form to save the mail being sent.but the window get opens after sending mail. i want windows form before sending mail to prompt the user to save the sending mail.
    Tuesday, September 25, 2012 4:06 AM
  • The ItemSend happens after the user clicks "send", but before the mail is being sent.
    You can do your manipulation, and once you give the control back to Outlook, it'll actually send the mail.
    If you want to, you can cancel the meeting using the ref parameter Cancel (set it to True)

    If you want the form to pop-up before the user click "send", you'll have to give us some more information. What do you see as a trigger? How can the application "guess" that the user is about to send the email? (But I would use what Ken wrote. The SendItem event is good enough).
    Tuesday, September 25, 2012 7:08 AM
  • I want to prompt the user while sending mail where he want to save the sending mail with attachment.How could i do that?As soon as user press the send button the windows form should get appear and until and unless i complete the action the mail should not be get send...

    i did

     but not working as per my need

    public void Application_ItemSend(object Item, ref bool Cancel)
            {

                SendMailFile smail = new SendMailFile();           
                smail.Show();

               
            }

    This code shows me the windows form after mail get sent

    Tuesday, September 25, 2012 7:46 AM
  • Your form should be blocking -  use ShowDialog.
    (If you use Show, the form will be displayed, but the code that called it will continue running)

    Tuesday, September 25, 2012 8:21 AM
  • Moshe_Malin    

    yOU ARE AWESOME!!!!

    bUT could you please tell me, now you can visualize that i am sending a mail, i pressed send button .

    I got the windows form with tree view control showing folders name. if i select a particular folder from tree view then that mail should be saved to folder i selected from tree view.

    which mail i want to save--??? the one which is i am sending.AS it is

    Tuesday, September 25, 2012 8:29 AM
  • Yes, you should use the Item you get from the ItemSendEvent, and try using what Ken has suggested -  SaveSentMessageFolder.

    Tuesday, September 25, 2012 9:06 AM
  • Could you please post code snippet so that i can start moving on it....

    it's looking very interesting...

    PLease post some Code snippet

    Tuesday, September 25, 2012 9:09 AM
  • Tuesday, September 25, 2012 11:49 AM