Outlook Reply generated using VBA Not Showing Send Button

MEG ADV 1 Reputation point
2021-05-10T15:37:54.65+00:00

Using VBA within Access, I'm trying to reply to an email with a template. The code below works to create this reply and displays it properly..

However, the user wants to review the email prior to sending. When the email is displayed, it doesn't show the SEND button.

The subroutine performs a .display to show the email. Do I need to use a different command?

Any ideas would be appreciated.

' Email Response
'
' Parameters
' Template for reply
' Email Box to find Email
' Email Address to Respond

Sub srtnGenerateReply(ByVal sTemplateText As String, ByVal sEmailMailBox As String, ByVal sEmailAddress As String)

Dim OutlookApp As outlook.Application
Dim OutlookNamespace As outlook.NameSpace
Dim olShareName As outlook.Recipient
Dim Folder As MAPIFolder
Dim olItems As outlook.Items
Dim OutlookMail As Variant
Dim arrResults() As Variant
Dim ItemCount As Long

Dim sFilter As String

sFilter = "[SenderEmailAddress] = '" & sEmailAddress & "'"

Set OutlookApp = New outlook.Application
Set OutlookNamespace = OutlookApp.GetNamespace("MAPI")
Set olShareName = OutlookNamespace.CreateRecipient(sEmailMailBox)
Set Folder = OutlookNamespace.GetSharedDefaultFolder(olShareName, olFolderInbox)
Set olItems = Folder.Items.Restrict(sFilter)

' sort to get the most recent email for the Email Address to respond
olItems.Sort "[ReceivedTime]", True

If olItems.Count < 1 Then
MsgBox ("No Email Found")
End If

For Each OutlookMail In olItems

OutlookMail.ReplyAll

OutlookMail.HTMLBody = sTemplateText & _
" <hr> <br/>" & _
"<b>From: </b>" & OutlookMail.SenderName & " [" & OutlookMail.SenderEmailAddress & "]<br/>" & _
"<b>Sent: </b>" & OutlookMail.SentOn & "<br/>" & _
"<b>To: </b>" & OutlookMail.To & "<br/>" & _
"<b>Subject: </b>" & OutlookMail.Subject & "<br/>" & _
"<br/>" & _
OutlookMail.HTMLBody\

OutlookMail.Display

Exit For ' Exit -- Only reply to lastest email

Next OutlookMail

Set OutlookApp = Nothing
Set OutlookNamespace = Nothing

End Sub

Developer technologies Visual Basic for Applications
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MEG ADV 1 Reputation point
    2021-05-27T14:13:43.713+00:00

    Again the user wants to reveiw the email and possibly add additional text to the base template.

    However, when it is displayed, the SEND button is not enabled.

    Any thoughts?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.