Hello all! Long time lurker and appreciate all the help and tips I've been able to pick up. I am looking for a way to copy an email address in the body of an open email and pasting it into the To field. Can this be done?
I am currently copying a full page from a word document and pasting it into an Outlook email. The email address(s) will be in the same location on each page.
This is my code.
Thanks as always!!
I am currently copying a full page from a word document and pasting it into an Outlook email. The email address(s) will be in the same location on each page.
This is my code.
Code:
Sub Paste()
Dim OutApp As Object
Dim OutMail As Object
Dim olInsp As Object
Dim MyItem As Outlook.MailItem
Dim str_jpeg_file As String
str_jpeg_file = "F:\User\New folder\Logo.jpg"
'Dim xlSheet As Worksheet
Dim wdDoc As Object
Dim oRng As Object
'Set xlSheet = ActiveWorkbook.Sheets("Unapproved")
'xlSheet.UsedRange.Copy
'On Error Resume Next
Set OutApp = GetObject(, "Outlook.Application")
If Err <> 0 Then Set OutApp = CreateObject("Outlook.Application")
On Error GoTo 0
'Set OutMail = OutApp.CreateItem(0)
Set MyItem = Application.CreateItemFromTemplate("H:\Templates\Statement Customer .msg")
MyItem.Display
With MyItem
.BodyFormat = 2
.To = ""
.CC = ""
.BCC = ""
.Subject = "Customer Statement "
SendKeys "{right}{down}^({v})", True
End With
End Sub
Thanks as always!!