Results 1 to 3 of 3

How to send email to Lotus Notes using Excel with link of the Excel file inside the email?

Threaded View

EvelynLoh How to send email to Lotus... 02-13-2014, 05:51 AM
EvelynLoh Re: How to send email to... 02-13-2014, 10:18 PM
alansidman Re: How to send email to... 02-14-2014, 12:03 AM
  1. #1
    Forum Contributor
    Join Date
    11-07-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    100

    How to send email to Lotus Notes using Excel with link of the Excel file inside the email?

    Dear All,

    Am still learning Excel Macro programming. Have manage to send email using Excel Macro to Lotus Notes but not sure how to send the email with the Excel link attach in Lotus Notes so that when people read the email in Lotus Notes can click a link to open up the Excel file straight away instead of search the excel file through the folders.

    Am using below script to send email, can advise me on the script on how to send the email with the link of the Excel file too? Urgently need help.
    Private Sub Bib5_Click()
    Dim wkNSes As Object    ' lotus.NOTESSESSION
        Dim wkNDB As Object     ' lotus.NOTESDATABASE
        Dim wkNDoc As Object    ' lotus.NOTESDOCUMENT
        Dim wkNRtItem As Object ' lotus.NOTESRICHTEXTITEM
        Dim wkNAtt As Object    ' lotus.NOTESEMBEDDEDOBJECT
        Dim AttFName As String  ' Attachment File Name(Full name path)
        Dim Adress As Variant
        Dim Title As String
        Dim Detail As String
        Dim Bidder As String
        Dim Amount As String
        Dim iCounter As Integer
    
    
        ' Notes session boot up
        Set wkNSes = CreateObject("Notes.NotesSession")
        ' Create NotesDatabase Object and open DB
        Set wkNDB = wkNSes.GETDATABASE("", "")
        ' Open NotesDB after allocate user's mail DB
        wkNDB.OpenMail
    
        ' Create NotesDB doc, and set object varuable to new doc
        Set wkNDoc = wkNDB.CREATEDOCUMENT()
        ' Set Title
        wkNDoc.Subject = "Fifth Bidder for Auction 1"
        ' Set Attention
            
        Sheets("Auction").Select
        Cells(3, 2).Select
        Title = ActiveCell.Value
        Cells(7, 2).Select
        Detail = ActiveCell.Value
        Cells(26, 2).Select
        Bidder = ActiveCell.Value
        Cells(26, 5).Select
        Amount = ActiveCell.Value
            
        
        'wkNDoc.SendTo = Array("wakahara@discosin.com.sg", "evelyn@discosin.com.sg")
                'wkNDoc.SendTo = Adress
    
    Dim Sendmail_List(250) As Variant
            Dim k As Integer
                
                'Sendmail_List = Array()
                
                Sheets("Auction").Select
                Cells(100, 1).Select
                Adress = ActiveCell.Value
                
                k = 0
                
                Do Until Adress = ""
                
                    ActiveCell.Offset(1, 0).Activate
            
                    Adress = ActiveCell.Value
    
                    Sendmail_List(k) = ActiveCell.Value
            
                    k = k + 1
                
                Loop
                
                If SalesEngineer.Value = True Then
            
                Cells(100, 9).Select
                Adress = ActiveCell.Value
            
                Do Until Adress = ""
                
                    ActiveCell.Offset(1, 0).Activate
            
                    Adress = ActiveCell.Value
    
                    Sendmail_List(k) = ActiveCell.Value
            
                    k = k + 1
                
                Loop
            
            
            End If
            
       wkNDoc.SendTo = Sendmail_List
    
    
            'wkNDoc.CopyTo = Array("xxx@xxx")
        'wkNDoc.blindCopyTo = Array("xxx@xxx")
    
        ' Create rich text item in doc
        Set wkNRtItem = wkNDoc.CreateRichTextItem("BODY")
        ' Set body
        With wkNRtItem
            .APPENDTEXT Title
            .ADDNEWLINE 2
            .APPENDTEXT Detail
            .ADDNEWLINE 3
            .APPENDTEXT "Please visit the Auction Navigator to bid for this job under Auction 1 Button if you still want to Bid."
            .ADDNEWLINE 3
            .APPENDTEXT Bidder
            .ADDNEWLINE 1
            .APPENDTEXT Amount
            
            ' Set attachment file
            'AttFName = "X:\DHS Common Share\Application\Auctions\Auction 1.xls"
            ' Attachment file
            'Set wkNAtt = .EmbedObject(EMBED_ATTACHMENT, "", AttFName)  <============================== This line doesn't work to create the 
    
                                                                                                        link inside the email.
           ' .ADDTAB 1
            '.ADDNEWLINE 1
        End With
    
        ' Send e-mail
        wkNDoc.Send False
    
        ' Unload object varuable
        Set wkNAtt = Nothing
        Set wkNRtItem = Nothing
        Set wkNDoc = Nothing
        Set wkNDB = Nothing
        Set wkNSes = Nothing
        Range("Auction!J26") = Date
    
    
        MsgBox "Mail Sent", vbOKOnly + vbInformation
        ActiveWorkbook.Close SaveChanges:=True
    
    
    End Sub

    Thank you.
    Last edited by alansidman; 02-14-2014 at 12:02 AM. Reason: code tags added

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using Excel to send an email through Lotus Notes
    By mrfibbers in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-25-2012, 08:46 AM
  2. Excel Send Email Using Lotus Notes 8
    By physco827 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2010, 03:18 PM
  3. Automation - Send Email via excel sheet and lotus notes
    By IamDBest in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2007, 07:05 AM
  4. Excel VBA to send email using Lotus Notes
    By Nirmal Singh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-28-2005, 07:06 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