+ Reply to Thread
Results 1 to 6 of 6

create send email button per line

  1. #1
    Registered User
    Join Date
    03-01-2019
    Location
    Lisbon
    MS-Off Ver
    2016
    Posts
    20

    create send email button per line

    hello,

    How can I create a send email button so that it sends the header and the one of the lines?
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-01-2019
    Location
    Lisbon
    MS-Off Ver
    2016
    Posts
    20

    Re: create send email button per line

    anyone please?

  3. #3
    Forum Contributor
    Join Date
    04-30-2015
    Location
    The Netherlands
    MS-Off Ver
    office 365
    Posts
    195

    Re: create send email button per line

    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.

  4. #4
    Registered User
    Join Date
    03-01-2019
    Location
    Lisbon
    MS-Off Ver
    2016
    Posts
    20

    Re: create send email button per line

    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...

  5. #5
    Registered User
    Join Date
    03-01-2019
    Location
    Lisbon
    MS-Off Ver
    2016
    Posts
    20

    Re: create send email button per line

    any more info I can provide?

  6. #6
    Registered User
    Join Date
    03-01-2019
    Location
    Lisbon
    MS-Off Ver
    2016
    Posts
    20

    Re: create send email button per line

    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?
    Attached Files Attached Files
    Last edited by Mike69pt; 03-15-2019 at 08:58 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Press button, send email
    By RankSinatra in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-06-2018, 01:29 AM
  2. Create a button that will automatically send an email
    By Mattyevs1000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-31-2016, 06:14 PM
  3. Send Email when I press "Send" button in Outlook
    By qzqzjcjp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2015, 09:37 AM
  4. [SOLVED] Create macro to send worksheet as body of email using cells as subject line
    By LindaABH in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-16-2012, 07:43 PM
  5. Excel to send email from VBA button
    By Benjamin2008 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-08-2012, 07:56 PM
  6. Button - Send email
    By Wiets in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-06-2008, 09:04 PM
  7. send email from button
    By andreww in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2005, 11:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1