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?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
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?