hello,
How can I create a send email button so that it sends the header and the one of the lines?
hello,
How can I create a send email button so that it sends the header and the one of the lines?
anyone please?![]()
If I understand you correctly you want to send the first row and than a certain row below it? (please confirm or elaborate)
To send an email you will atleast need a cell on each row that shows the email of the recipient and a subject is also very useful.
Remember to mark as Solved and give out rep.
yes, I would want a column with the corresponding email address (recipient) include the following data from A1 to R1 and then A2 to R2 or A3 to R3...
any more info I can provide?
I've managed to kind of do it using:
Sub Line3()
Dim outlook As Object
Dim newEmail As Object
Dim xInspect As Object
Dim pageEditor As Object
Set outlook = CreateObject("Outlook.Application")
Set newEmail = outlook.CreateItem(0)
With newEmail
.To = Sheet1.Range("A3").Text
.CC = ""
.BCC = ""
.Subject = "Data"
.Body = "Please find the requested information" & vbCrLf & "Best Regards"
.display
Set xInspect = newEmail.GetInspector
Set pageEditor = xInspect.WordEditor
Sheet1.Range("B1:S1, B3:S3").Copy
pageEditor.Application.Selection.Start = Len(.Body)
pageEditor.Application.Selection.End = pageEditor.Application.Selection.Start
pageEditor.Application.Selection.PasteAndFormat (wdFormatPlainText)
.display
.Send
Set pageEditor = Nothing
Set xInspect = Nothing
End With
Set newEmail = Nothing
Set outlook = Nothing
End Sub
The only problem is that Sheet1.Range("B1:S1, B3:S3").Copy also copies B2:S2 on to the email
any ideas why?
Last edited by Mike69pt; 03-15-2019 at 08:58 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks