Share via

Code to sendeemail from Excel and request read receipt

Anonymous
2012-11-30T10:29:30+00:00

Hi

With huge assistance from Ron de Bruin's excellent site I have the following code which allows users to alert me when they have made changes to a sheet in a shared folder so I can action them. This does what i need - except - I cannot work out how to get Outlook to send a read receipt to whomever sends the email. Code I have is:

Sub Make_Outlook_Mail_With_File_Link()

'Working in Office 2000-2010

    Dim OutApp As Object

    Dim OutMail As Object

    Dim strbody As String

    If ActiveWorkbook.Path <> "" Then

        Set OutApp = CreateObject("Outlook.Application")

        Set OutMail = OutApp.CreateItem(0)

        strbody = "<font size=""3"" face=""Arial"">" & _

                  "Hi BST,<br><br>" & _

                  "I want to make some changes to access to Communications :<br>" & _

                  "Click on this link to open the file and action amendments please: " & _

                  "<A HREF=""file://" & ActiveWorkbook.FullName & _

                  """>Link to the file</A>" & _

                  "<br><br>Thanks,"

        On Error Resume Next

        With OutMail

            .to = "******@me.com            .CC = ""

            .BCC = ""

            .Subject = "Action Reqd - Changes to Access to Comms North"

            .HTMLBody = strbody

            .Send   'or use .Dispaly

          .ReturnReceipt = "True"

        End With

        On Error GoTo 0

        Set OutMail = Nothing

        Set OutApp = Nothing

    Else

        MsgBox "The ActiveWorkbook does not have a path, Save the file first."

    End If

End Sub

CAn anyone help please?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-11-30T15:32:28+00:00

This property doesn't exist, and when setting properties the value should be a boolean, not a string:

 .ReturnReceipt = "True"

So try:

 .ReadReceiptRequested = True

Note that the sender can only request a receipt, but the recipient can choose to not send receipts by default or on a case by case basis. If the sender has not requested a receipt, the recipient cannot generate one (other than by replying to the mail).

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2012-11-30T18:10:39+00:00

    Thank you - that is perfect!

    Was this answer helpful?

    0 comments No comments