Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9005903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:16:06+00:00 2026-06-16T01:16:06+00:00

I’d like to build\edit the mail signiture in Excel: 1st cell : |Regards, |

  • 0

I’d like to build\edit the mail signiture in Excel:

1st cell        : |Regards,      |
2nd cell (Name) : |Asaf Gilad    |
3rd Cell (Title): |PMO           |
4th cell (Mail) : |Asaf@mail.com |

So that when I click send, the body of the message will look like:

Dear sir
................................
....... Message Content ........
................................
................................

Regards,
Asaf Gilad    
PMO           
Asaf@mail.com 

The signiture contains pictures as well.

I managed to save the range as picture and send that picture as attachment, but the picture turned out to be empty in the body, dispite the fact that it was sent correctly as attachment.

Here is the code I use:

Public Sub ExportEmail(recipentName As String)
    On Error GoTo err:
    Dim olApp As Outlook.Application
    Dim olNs As Outlook.Namespace
    Dim olMail As Outlook.MailItem
    Dim strEmailTo As String, strEmailCC As String, strEmailBCC As String 
    Dim FNAME As String
    Dim oRange As Range
    Dim oChart As Chart
    Dim oImg As Picture
    strEmailTo = ""
    strEmailCC = ""
    strEmailBCC = ""
    strEmailTo = "a@a.com"
    strEmailCC = "b@b.com
    If strEmailTo  "" Then
        Set olApp = New Outlook.Application
        Set olNs = olApp.GetNamespace("MAPI")
        olNs.Logon
        Set olMail = olApp.CreateItem(olMailItem)
        olMail.To = strEmailTo
        olMail.CC = strEmailCC
        olMail.BCC = strEmailBCC
        olMail.Subject = " My Subject"
        Set oRange = Sheets(1).Range("A1:Z100") 
        Set oChart = Charts.Add
        oRange.CopyPicture xlScreen, xlPicture
        oChart.Paste
        FNAME = Environ$("temp") & "\testPic.gif"
        oChart.Export Filename:=FNAME, FilterName:="GIF"
        olMail.Attachments.Add FNAME
        olMail.HTMLBody = "" & _
            ""
        olMail.Attachments.Add FNAME
        olMail.Send
    End If
    Application.StatusBar = False
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    Kill FNAME
    Set olApp = Nothing
    Set olNs = Nothing
    Set oRange = Nothing
    Set oChart = Nothing
    Set oImg = Nothing
    Exit Sub
err:
    MsgBox err.Description
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:16:07+00:00Added an answer on June 16, 2026 at 1:16 am

    This is a good question, Asaf. When I have built automated e-mail solutions, I’ve found it difficult to get the signature line in. It’s possible, but not easy. Maybe it’s updated in 2010, but I haven’t checked yet.

    What I do is place the entire body into a text file on a drive, complete with any html tags that I want for formatting. This gives me great flexibility in both making nicely formatted e-mails where I can assign variables as well.

    I then access those files through the Microsoft Scripting Runtime library.

    See below code snippets:

    Option Explicit
    
    Const strEmailBoiler As String = "\\server\path\folder\subfolder\email_text\"
    
    Sub PrepMessage()
    
    Dim strBody As String, strMon As String
    
    strMon = range("Mon").Value
    strFY = range("FY").Value
    strBody = FileToString(strEmailBoiler, "reports_email_body.txt")
    
    strBody = Replace(strBody, "[MONTH]", strMon)
    strBody = Replace(strBody, "[YEAR]", Right(strFY, 2))
    strBody = Replace(strBody, "[FILE PATH]", strFileName)
    
    SendMail "firstname.lastname@xyz.com", "Subject Goes Here " & strMon & " YTD", strBody
    
    End Sub
    
    Function FileToString(ByVal strPath As String, ByVal strFile As String) As String
    'requires reference to Microsoft Scripting Runtime Object Library (or late binding)
    
        Dim ts As TextStream
    
        Set fso = New FileSystemObject
        Set ts = fso.OpenTextFile(strPath & strFile, ForReading, False, TristateUseDefault)
    
        FileToString = ts.ReadAll
        ts.Close
    
        Set ts = Nothing
        Set fso = Nothing
    
    End Function
    
    Sub SendMail(strTo As String, strSubject As String, strHTMLBody As String, Optional strAttach As String, Optional strCC As String)
    'requires reference to Microsoft Outlook X.X Object Library (or late binding)
    
    Dim olApp As Outlook.Application
    Dim olMI As Outlook.MailItem
    
    Set olApp = CreateObject("Outlook.Application")
    Set olMI = olApp.CreateItem(olMailItem)
    
    With olMI
    
        .To = strTo
        .Subject = strSubject
        .HTMLBody = strHTMLBody
        If strAttach <> vbNullString Then .Attachments.Add strAttach
        .Display 'using this because of security access to Outlook
        '.Send
    
    End With
    
    End Sub
    

    Then my reports_email_body.txt file will look like this:

    <p>Hello Person,</p> 
    <p>The Reports file for [MONTH] FY[YEAR] has been saved in the following location:</p>
    <p><a href="[FILE PATH]">[FILE PATH]</a></p>
    <p>Best,</p>
    <br>
    Scott Holtzman
    <br>My Address
    <br>my title
    <br>whatever else...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.