Michael James
Michael James

Reputation: 606

Excel VBA to Send Outlook Message Getting Error When trying to send - "The Message cannot be modified"

This code is opening an outlook msg file from Excel VBA:

Sub Interim_Email_1()

Dim OutApp As Object
Dim OutMail As Object
Dim OutWordEdit As Object
Dim OutCurrItem As Object

'pPath = ActiveWorkbook.Path & "\Interim\"

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.Session.OpenSharedItem(pPath & "1_First Contact with TL Template.msg")

The excel VBA is in a read-only workbook, saved to the user's local desktop. The msg file is in a folder on sharepoint. I've checked folder and file permissions for this sharepoint location, and they are ok for the tested accounts. The email opens ok on the tested accounts.

Most accounts are able to send the email message. However, one account is giving the following error message when trying to send: "The message cannot be modified. You may not have permissions to modify the message. To save your changes click the file tab and then click save as."

Are there additional security or permission levels that should be confirmed in Outlook or otherwise?

Let me know how to configure this appropriately such that this user can send emails as loaded programatically.

Upvotes: 0

Views: 544

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66255

Standalone MSG files cannot be sent. If you are using the MSG file as a template, use an OFT file instead of MSG, and call Application.CreateItemFromTemplate.

Upvotes: 1

Related Questions