Excel VBA Email Envelope Embed two ranges in the body

Hi

I use the following code to build an email in the Mail Envelope
I want to embed two small ranges in the body. How do I do this?


            With Globals.ThisAddIn.Application.ActiveSheet.MailEnvelope
                        .Visible = True
                        .Item.To = oDetail
                        .Item.Cc = oDetail2
                        .Item.Subject = oDetail3
                        .Item.Body = oDetail4
                        .Attachment = oDetail5
                        '.Item.Send()
                    End With
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
Rgonzo1971Commented:
HI,

pls try (for example)

With Globals.ThisAddIn.Application.ActiveSheet.MailEnvelope
                         .Visible = True
                         .Item.To = oDetail
                         .Item.Cc = oDetail2
                         .Item.Subject = oDetail3
                         .Item.Body = "your text" & Activesheet.Range("A1") & " and " & Range("B2")
                         .Attachment = oDetail5
                         '.Item.Send()
                     End With

Open in new window

Regards
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Hi
I got the error
Public member 'Attachment' on type 'IMsoEnvelopeVB' not found.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
but of course you answered my question. Thanks very much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.