Copy and paste body and subject and send multiple emails

Status
Not open for further replies.

VB NB

New Member
Outlook version
Outlook 2007
Email Account
POP3
Hello,
I want to copy the body and subject of a current email and send it to different distribution list.
Here is what I found in this forum : I made some changes to adapt to my project.

Sub Old_reply()
Dim objApp
Dim objInsp
Dim Mail As Outlook.MailItem
On Error Resume Next
Set objApp = GetObject("", "Outlook.Application")
If objApp Is Nothing Then
Set objApp = Application.CreateObject("Outlook.Application")
End If
Set objInsp = objApp.ActiveInspector.CurrentItem
If TypeName(objInsp) = "Nothing" Then
MsgBox "No inspector window found"
Exit Sub
Else
Set Mail = Outlook.CreateItem(olMailItem)
With Mail
.To = "mymail@mymail.com"
.BCC = "List1"
.Subject = objInsp.Subject
.Body = objInsp.Body
.Send
End With
Set Mail = Nothing

Set Mail2 = Outlook.CreateItem(olMailItem)
With Mail2
.To = "mymail@mymail.com"
.BCC = "List2"
.Subject = objInsp.Subject
.Body = objInsp.Body
.Send
End With
Set Mail2 = Nothing
End If
End Sub

Problem : macro doesn't copy the subject line.

Can you help me ?

Thanks a lot in advance
Vince
 

VB NB

New Member
Outlook version
Outlook 2007
Email Account
POP3
I checked the code again and it seems to work now.
So ... problem resolved.

Thanks
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
As an FYI, because Outlook is open (you are working in it) you don't need to check for it.
Set objApp = Outlook.Application
Set objInsp = objApp.ActiveInspector.CurrentItem

If you were creating a message from Excel or Word, you'd use get/create object.
 
Status
Not open for further replies.
Top