+ Reply to Thread
Results 1 to 4 of 4

code to paste the content of specific cells into the email generated by VBA

  1. #1
    Registered User
    Join Date
    12-22-2015
    Location
    uae
    MS-Off Ver
    2013
    Posts
    6

    code to paste the content of specific cells into the email generated by VBA

    HI ALL,

    i have wrote a vba to generate the an email from clinking on a command button it shows as below

    Option Explicit

    Private Sub CommandButton1_Click()

    On Error GoTo ErrHandler

    ' SET Outlook APPLICATION OBJECT.
    Dim objOutlook As Object
    Set objOutlook = CreateObject("Outlook.Application")

    ' CREATE EMAIL OBJECT.
    Dim objEmail As Object
    Set objEmail = objOutlook.CreateItem(olMailItem)

    With objEmail
    .to = "[email protected]"
    .Subject = "This is a test message from Arun Banik"
    .Body = "Hi there"
    .Display ' DISPLAY MESSAGE.
    End With

    ' CLEAR.
    Set objEmail = Nothing: Set objOutlook = Nothing

    ErrHandler:
    '
    End sub

    i just need a code to add the content of a specific number of cells into the body of the email, please help.

    thanx
    garfen

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    re: code to paste the content of specific cells into the email generated by VBA

    This link may help.
    Mail from Excel with Outlook (Windows)
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    12-22-2015
    Location
    uae
    MS-Off Ver
    2013
    Posts
    6

    re: code to paste the content of specific cells into the email generated by VBA

    hi alpha, thanx for the fast reply.

    i am checking it right now.

    regards
    garfen

  4. #4
    Registered User
    Join Date
    12-22-2015
    Location
    uae
    MS-Off Ver
    2013
    Posts
    6

    Re: code to paste the content of specific cells into the email generated by VBA

    hi man,

    i am trying it its not working, alot of errors its killing me, is there any way that you can please paste the code here and tell me where to add it exactly, i am not that good with excel.

    thank you

+ 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. [SOLVED] Help with VBA Code - Find cells with specific value, Copy/Paste value from adjacent colmns
    By Mikeyc85 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-09-2015, 12:32 PM
  2. [SOLVED] VBA macro to find specific cells, copy the content and paste to ranges
    By tauterouff in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-28-2014, 09:14 AM
  3. [SOLVED] Making a filepath a hyperlink in an email generated with code
    By MissDB in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-17-2014, 07:33 AM
  4. [SOLVED] Move cells containing specific content into a specific column
    By mb5555 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2012, 01:46 AM
  5. [SOLVED] Change Font Size/Color on one line of an email automatically generated by a code.
    By coxb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2012, 01:55 PM
  6. Code to scrape system generated outlook email doesn't get all the data
    By bobaftt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2010, 01:57 PM
  7. copy & paste a specific content
    By ghappybee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-02-2010, 11:44 PM

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