M
Mary
I have the following code and want to paste the data copied from the first
part of the macro into the message body. I didn't see any examples of how to
paste, can anyone help?
*****************************************
Sub SendPage()
'
' SendPage Macro
'
'
Cells.Find(What:="bridge", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
Range("B2:B7").Select
Selection.Copy
Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True
Set oMailItem = oOutlook.CreateItem(0)
Set oRecipient = _
oMailItem.Recipients.Add("(e-mail address removed)")
oRecipient.Type = 1 '1 = To, use 2 for cc
With oMailItem
.Subject = "**Outage Bridge**"
.Body = "paste here"
' .Attachments.Add ("filename") 'you only need this if
'you are sending attachments?
.Display 'use .Send when all testing done
End With
End Sub
*********************************************
Thanks in advance!
Mary
part of the macro into the message body. I didn't see any examples of how to
paste, can anyone help?
*****************************************
Sub SendPage()
'
' SendPage Macro
'
'
Cells.Find(What:="bridge", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
Range("B2:B7").Select
Selection.Copy
Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True
Set oMailItem = oOutlook.CreateItem(0)
Set oRecipient = _
oMailItem.Recipients.Add("(e-mail address removed)")
oRecipient.Type = 1 '1 = To, use 2 for cc
With oMailItem
.Subject = "**Outage Bridge**"
.Body = "paste here"
' .Attachments.Add ("filename") 'you only need this if
'you are sending attachments?
.Display 'use .Send when all testing done
End With
End Sub
*********************************************
Thanks in advance!
Mary