Results 1 to 4 of 4

Assistance changing VBA code to display as HTML or picture of a selection in Lotus Notes

Threaded View

robjula Assistance changing VBA code... 09-01-2024, 01:22 AM
AliGW Re: Assistance changing VBA... 09-01-2024, 03:20 AM
robjula Re: Assistance changing VBA... 09-01-2024, 03:26 AM
AliGW Re: Assistance changing VBA... 09-01-2024, 03:31 AM
  1. #1
    Registered User
    Join Date
    09-01-2024
    Location
    Miami
    MS-Off Ver
    Office 2021
    Posts
    2

    Assistance changing VBA code to display as HTML or picture of a selection in Lotus Notes

    Hello All.

    I have a workbook that sends a copy via Lotus Notes. The body of the e-mail is text from the excel workbook. Unfortunately it does not look good and I would like to change the code to paste either as HTML, Jpeg or some option to make it readable for recipients without the need to open the excel attachment.

    Here is my code:

    Appreciate any and all help.

                vDay = 0
    
        End Select
    
           
    
        EMBED_ATTACHMENT = 1454
    
       
    
        ' Define the range to copy (adjust the range as needed)
    
        Set rng = ActiveSheet.Range("A1:U20")
    
       
    
        ' Convert the range to text by looping through each cell
    
        rngText = ""
    
        For Each cell In rng
    
            rngText = rngText & cell.Value & vbTab
    
            If cell.Column = rng.Columns.Count Then
    
                rngText = rngText & vbNewLine
    
            End If
    
        Next cell
    
    
    
    
        ' Prepare email body with the range text
    
        bodytext = "Good Morning," & vbNewLine & vbNewLine
    
        bodytext = bodytext & "Attached above is the revenue report from last night." & vbNewLine & vbNewLine
    
        bodytext = bodytext & "Below is a summary of the report:" & vbNewLine & vbNewLine
    
        bodytext = bodytext & rngText & vbNewLine & vbNewLine
    
        bodytext = bodytext & "Thanks," & vbNewLine
    
        bodytext = bodytext & "The C Team" & vbNewLine & vbNewLine
    bodytext = bodytext & "This is a system generated email."
    
    
        Set wb1 = ThisWorkbook
    
        stSubject = "Daily C Report - Day " & vDay
    ' Copy the active sheet to a new temporary workbook.
    
        With ActiveSheet
    
            .Copy
    
            stFileName = "Daily C.xlsm"
    
        End With
    
    noDocument.CREATERICHTEXTITEM("stAttachment")
    
        Set noEmbedObject = noAttachment.EmbedObject(EMBED_ATTACHMENT, "", stAttachment)
    
       
    
        ' Add values to the created e-mail main properties.
    
        With noDocument
    
            .Form = "Memo"
    
            .SendTo = vaRecipients
    
            .CopyTo = vaCopyTo
    
            .Subject = stSubject
    
            .Body = bodytext
    
            .SaveMessageOnSend = False
    
            .PostedDate = Now()
    
            .Send 0, vaRecipients
    
        End With
    
       
    
        ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:=PW
    
       
    
        ' Delete the temporary workbook.
    
        Kill stAttachment
    
       
    
        ' Release objects from memory.
    
        Set noEmbedObject = Nothing
    
        Set noAttachment = Nothing
    
        Set noDocument = Nothing
    
        Set noDatabase = Nothing
    
        Set noSession = Nothing
    
       
    
        MsgBox "The Daily Revenue Report has been successfully detached and e-mailed to the R", 
    vbInformation
    Application.DisplayAlerts = True
    
    
    
    End Sub
    Last edited by AliGW; 09-01-2024 at 02:28 AM. Reason: Code tags added - please review the forum guidelines.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. EMAIL BODY IN HTML FORMAT - Lotus Notes
    By Ravisca2003 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2017, 08:54 AM
  2. [SOLVED] sending network path in HTML email via VBA in Lotus Notes
    By BellyGas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2017, 08:57 AM
  3. VBA Assistance - Emailing from Lotus Notes 8.5
    By Bigtaff in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2014, 06:09 AM
  4. Email HTML Hotspot from Lotus Notes - Initialize Help Needed
    By sparrowce in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-23-2013, 09:50 AM
  5. Changing VBA code from Outlook to Lotus Notes
    By tommytee in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-01-2011, 07:05 AM
  6. Automate Lotus Notes email with HTML body from excel
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-25-2010, 06:47 PM
  7. VBA to send email (possibly containing HTML) to multiple contacts in Lotus Notes
    By diablodvs7 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2008, 10:20 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