Results 1 to 4 of 4

Help - Attach an image from the userform into the body of an email in lotus notes

Threaded View

  1. #1
    Registered User
    Join Date
    09-12-2013
    Location
    London
    MS-Off Ver
    Excel 2009
    Posts
    3

    Help - Attach an image from the userform into the body of an email in lotus notes

    Hi everybody.

    I am new to this forum and relevently new to vba in Excel.

    What I need help with is i have a userform which sends an email with selected textboxes within the userform and this gets attached to the body of the email. However I would like it to also attach the image which is either stored in the userform or from a stored storage location on our server.

    Below is the current code any idea? would be greatly appreciated thanks


      Dim oSess As Object
        Dim oDB As Object
        Dim oDoc As Object
        Dim oItem As Object
        Dim Direct As Object
        Dim Var As Variant
        Dim flag As Boolean
        Set oSess = CreateObject("Notes.NotesSession")
       Set oDB = oSess.GETDATABASE("", "")
        Call oDB.OPENMAIL
        flag = True
        If Not (oDB.IsOpen) Then flag = oDB.Open("", "")
         
        If Not flag Then
            Set oDB = oSess.GETDATABASE("", "Mail2/" & oDB.FILEPATH)
            'MsgBox "Can't open mail file: " & oDB.SERVER & " " & oDB.FILEPATH
            'GoTo exit_SendAttachment
        End If
        On Error GoTo err_handler
            
            
        Set oDoc = oDB.CREATEDOCUMENT
        Set oItem = oDoc.CREATERICHTEXTITEM("BODY")
        oDoc.Form = "Memo"
        oDoc.Subject = "New - Cost Reduction Idea  "
        oDoc.sendto = "Clive@y.com"
        oDoc.CopyTo = "Clive@Z.com"
        oDoc.body = "Please process the below Cost Reduction Idea" & Chr(10) & Chr(10) & "Date:  " & TextBox1 _
        & Chr(10) & Chr(10) & "Name of requester:  " & TextBox3 & Chr(10) & Chr(10) & "WWID of requester:  " & TextBox4 _
        & Chr(10) & Chr(10) & "Requesters Idea / Suggestion:  " & TextBox5 & Chr(10) & Chr(10) & " Thank you  "
     
        
    
        oDoc.postdate = Date
        oDoc.SaveMessageOnSend = True
     
    
        oDoc.visable = True
         'Sending Message
        oDoc.SEND False
    exit_SendAttachment:
        On Error Resume Next
        Set oSess = Nothing
        Set oDB = Nothing
        Set oDoc = Nothing
        Set oItem = Nothing
         'Done
    
        
    err_handler:
        If Err.Number = 7225 Then
            MsgBox "File doesn't exist"
        Else
            'MsgBox Err.Number & " " & Err.Description
        End If
        On Error GoTo exit_SendAttachment
        
        MsgBox "Your Cost Reduction Idea has been sent thank you"
        
    
    ActiveWorkbook.Close Savechanges:=False
    Last edited by Fotis1991; 09-12-2013 at 05:10 AM. Reason: added code tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help! Macro to Generate email in Lotus Notes and automatically attach a file
    By elpollo87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-27-2012, 10:19 AM
  2. Bold Text in Email body Lotus notes
    By TonyforVBA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-05-2011, 11:29 AM
  3. 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
  4. Send cell range to the body of a Lotus Notes email
    By Rob0405 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-09-2009, 05:46 AM
  5. [SOLVED] Body Text properties when sending email through Lotus Notes via Macro
    By PCLIVE in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2006, 11:15 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