Body of Original Email Missing from Reply when Voting Buttons Used

L

LEH

I generate an email using VBA from an Access form that includes voting
buttons. The problem is the reply (voting response) does not include the
body of the original email sent out although the subject now includes the
voters choice. How can I enure the reply includes the text from the original
message?

Code used:

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add(Me!emailaddress)
objOutlookRecip.Type = olTo

' Add the CC recipient(s) to the message.
'Set objOutlookRecip = .Recipients.Add("Michael Suyama")
'objOutlookRecip.Type = olCC

' Add the BCC recipient(s) to the message.
'Set objOutlookRecip = .Recipients.Add("Andrew Fuller")
'objOutlookRecip.Type = olBCC

' Set the Subject, Body, and Importance of the message.
.Subject = "Timecard for Period Ending " & Me!Date1
.Body = strBody
.Importance = olImportanceHigh 'High importance
.VotingOptions = "Approved;Disapproved"

' retVal = Item_Send(objOutlookMsg)


' Add attachments to the message.
If Not IsMissing(AttachmentPath) Then
Set objOutlookAttach = .Attachments.Add(AttachmentPath)
End If

' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
.Display
' Should we display the message before sending?
'If DisplayMsg Then
' .Display
'Else
'.Save
'.Send
'End If
End With
Set objOutlook = Nothing
 
R

Ralph

Probably a better question for an Outlook forum. However I was able to
accomplish this by adding Actions to the message rather than VotingOptions
then setting the ReplyStyle on the Action to include original text. The
drawback is the user must vote then send the message. Below is the code. Good
luck.

Set objOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
Set objOlActionYes =objOutlookMsg.Actions.Add
Set objOlActionNo =objOutlookMsg.Actions.Add

objOlActionYes.Name="Approved"
objOlActionNo.Name="Disapproved"
objOlActionYes.ReplyStyle=olIncludeOriginalText
objOlActionNo.ReplyStyle=olIncludeOriginalText

With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add(Me!emailaddress)
objOutlookRecip.Type = olTo

' Add the CC recipient(s) to the message.
'Set objOutlookRecip = .Recipients.Add("Michael Suyama")
'objOutlookRecip.Type = olCC

' Add the BCC recipient(s) to the message.
'Set objOutlookRecip = .Recipients.Add("Andrew Fuller")
'objOutlookRecip.Type = olBCC

' Set the Subject, Body, and Importance of the message.
.Subject = "Timecard for Period Ending " & Me!Date1
.Body = strBody
.Importance = olImportanceHigh 'High importance
 
L

LEH

Great! Your solution worked exactly as you described and accomplishes what I
requested. Thanks Ralph for taking the time to respond.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top