locked
Read receipt RRS feed

  • Question

  • Hi all,

          How to automatically send read receipt(response) using VSTO

    i tried something like this but its not working

    Dim mfrom As String 
     
            Dim flagc As Integer 
            flagc = 0 
     
            Dim ons As Outlook.NameSpace = Me.Application.GetNamespace("MAPI"
            Dim inbox As Outlook.MAPIFolder = Me.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox) 
            Dim ur As Outlook.Items = inbox.Items.Restrict("[Unread]=true"
     
            For Each mail As Outlook.MailItem In ur 
                mfrom = mail.SenderEmailAddress 
                Dim msub As String = mail.Subject 
                MessageBox.Show(msub) 
                MessageBox.Show(mail.ReadReceiptRequested.ToString) '--- True 
                mail.ReadReceiptRequested = False 
                MessageBox.Show(mail.ReadReceiptRequested.ToString) '---- False 
     
                mail.UnRead = False     'But it becomes again true  here 
            Next 

    please help me out



    Wednesday, December 17, 2008 12:03 PM

Answers

  • Hi ,

    Sorry,it's my fault that not explained it clearly, what I mean is we could only turn off the Read Receipt response from User-Interface, not programmatically, to find Tracking(Sorry I used Track in my last reply, written mistake) Options Dailog please go to Tools menu
    ->Options->Email Options->Tracking Options.

    Thanks
    Thursday, December 25, 2008 2:17 AM

All replies

  • Hi ,

    I've go through your code,and found that after you set the properties of an MailItem, Please call mail.save() method to save your changes.

    this is just a suggestion, 'cause I could not reproduce this issue, I'm using Outlook 2007 and Visual Studio 2008.Your code works fine in my side.

    and if the issue remains please tell us your Outlook version and Visual Studio version.



    Thanks
    Monday, December 22, 2008 8:23 AM
  • Hi,

    i did as u suggested but it still does not seem to work below is the code after i changed,
            Dim flagc As Integer 
            flagc = 0 
     
            Dim ons As Outlook.NameSpace = Me.Application.GetNamespace("MAPI"
            Dim inbox As Outlook.MAPIFolder = Me.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox) 
            Dim ur As Outlook.Items = inbox.Items.Restrict("[Unread]=true"
     
            For Each mail As Outlook.MailItem In ur 
                mfrom = mail.SenderEmailAddress 
                Dim msub As String = mail.Subject 
                MessageBox.Show(msub) 
                MessageBox.Show(mail.ReadReceiptRequested.ToString) 
                mail.ReadReceiptRequested = False 
                mail.Save() 
                MessageBox.Show(mail.ReadReceiptRequested.ToString) 
     
                mail.UnRead = False         
            Next 

    i am using VS2008 along with office 2007 professional.., what i am trying to do is i select certain contacts and to those contacts i will not want to sent read receipt response even if they have asked so that is why i am trying to use the above code.

    achu
    Tuesday, December 23, 2008 5:10 AM
  • Hi ,

    I'm sorry, I've missunderstood your mean,as I read in your fist post you said you what want was  How to automatically send read receipt .

    But, If you want cancel the sending of read receipt I've no idea with this so far, 'cause it is sent by Exchange Server, and the ReadReceiptRequested property is "read-only" for sent Items. So as far as I know the only way is through UI(Track Options Dailog)to stop all the read receipt no matter whom the sender is.

    Thanks
    Wednesday, December 24, 2008 8:15 AM
  • hi,

        I am extremely sorry if i am being stupid but how do i track the option dialog box



    achu
    Wednesday, December 24, 2008 9:00 AM
  • Hi ,

    Sorry,it's my fault that not explained it clearly, what I mean is we could only turn off the Read Receipt response from User-Interface, not programmatically, to find Tracking(Sorry I used Track in my last reply, written mistake) Options Dailog please go to Tools menu
    ->Options->Email Options->Tracking Options.

    Thanks
    Thursday, December 25, 2008 2:17 AM
  • Hi Li,

         Thanks for the reply, so it means that we cannot do such a think using VSTO right

    achu
    Monday, December 29, 2008 5:54 AM
  • Yes, I think so.
    Monday, December 29, 2008 5:57 AM