Attachment.PropertyAccessor.SetProperty to create link to attachment no longer works in Office 365? RRS feed

  • Question

  • Hello,

    I have a piece of code which I have been using to create links in a email.

    The code below is just an example but has been working fine until I've moved to Office 365. No, it does not work anymore.

    The link created in the email body does not tie up with the attachment. 

    Private Sub attachementTool()
    Dim msg
    Dim attach
    Set msg = Application.CreateItem(0)
    msg.To = "me@gmail.com"
    msg.Subject = "test link"
    msg.HTMLBody = "<html><body>click <a href=""cid:attachCid1"">here</a> to open attachment <br />" & _
                    "click <a href=""cid:attachCid2"">here</a> to open attachment</body></html>"
    Set attach = msg.Attachments.Add("C:\Users\Me\Desktop\attach1.pdf")
    attach.PropertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/proptag/0x3712001F", "attachCid1"
    Set attach = msg.Attachments.Add("C:\Users\Me\Desktop\attach2.pdf")
    attach.PropertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/proptag/0x3712001F", "attachCid2"
    End Sub

    Can anyone confirm why this no longer works with 365?

    Please help.

    Thanks in advance.

    Wednesday, October 31, 2018 11:24 PM