Results 1 to 2 of 2

Email from text box with formatting

Threaded View

  1. #1
    Registered User
    Join Date
    07-27-2021
    Location
    Riga, Latvia
    MS-Off Ver
    MS Excel for MS 365
    Posts
    1

    Lightbulb Email from text box with formatting

    I have a template for the email contained in a shape in an Excel sheet, and the text in this Shape also contains bold formatting.
    However, when I run my macros to create an email from this template it does not keep the formatting.
    Please advise what can be changed for below code to generate the email and keep the format the same as in Excel shape.

    Dim OutApp As Object
    Dim OutMail As Object
    Dim subject_name As String
    subject_name = "DELIVERY ORDER " & MainWB.Sheets("Overview").Range("B3") & " ETA " & Format(MainWB.Sheets("Overview").Range("B4"), "DD-MM-YYYY")
    
    Set OutApp = CreateObject("Outlook.Application")
    OutApp.Session.Logon
    Set OutMail = OutApp.CreateItem(0)
    
    On Error Resume Next
    With OutMail
        .SentOnBehalfOfName = MainWB.Sheets("To send").Range("C2")
        .To = email_list
        .CC = MainWB.Sheets("To send").Range("C4")
        .BCC = ""
        .Subject = subject_name
        .Body = MainWB.Worksheets("To send").Shapes("TextBox 2").TextFrame.Characters.Text
        .attachments.Add TempFilePath & TempFileName & FileExtStr
        .display
    Last edited by viiktoryia; 07-28-2021 at 03:57 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Generating Outlook Email and inseting chart into email with Text body.
    By Hyperion1571 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-17-2019, 12:41 PM
  2. Replies: 1
    Last Post: 05-13-2018, 08:23 PM
  3. Sending Email with Email body in a cell keeping the formatting.
    By VBA_N_O_O_B in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2017, 11:35 PM
  4. [SOLVED] Creating email using Word document as email body – formatting lost
    By Chrispelletier in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-17-2016, 09:04 PM
  5. [SOLVED] Sending Email from a form button using text fields to build the email
    By jdoerr1021 in forum Access Tables & Databases
    Replies: 5
    Last Post: 06-05-2016, 10:22 PM
  6. Formatting Email Text
    By BennyAndTheInkJets in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2012, 10:45 AM
  7. Copy text and formatting in word doc to email
    By kaisermike in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2012, 04:59 AM

Tags for this Thread

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