Results 1 to 9 of 9

Sending Email through Lotus Notes

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Sending Email through Lotus Notes

    Awhile ago, a user on here by the name of Chippy really helped me out with a code to copy and paste a range of cells into lotus notes and send it to an email address defined in the macro.

    
    Sub Email_Excel_Cells()
    
        Dim NSession As Object
        Dim NUIWorkSpace As Object
        Dim NDoc As Object
        Dim NUIdoc As Object
        
        Set NSession = CreateObject("Notes.NotesSession")
        Set NUIWorkSpace = CreateObject("Notes.NotesUIWorkspace")
        
        Set NDoc = NUIWorkSpace.ComposeDocument("", "", "Memo")
        Set NUIdoc = NUIWorkSpace.CURRENTDOCUMENT
        
        With NUIdoc
            .FieldSetText "EnterSendTo", "to.email1@email.com, to.email2@email.com"
            .FieldSetText "EnterCopyTo", "cc.email@email.com"
            .FieldSetText "Subject", "Pasting from Excel to Lotus Notes " & Now
            .FieldSetText "Body", "Excel cells are pasted below this text" & vbNewLine & vbNewLine & _
                "**PASTE EXCEL CELLS HERE**" & vbNewLine & vbNewLine & _
                "Excel cells are pasted above this text"
                
            .GotoField ("Body")
            .FINDSTRING "**PASTE EXCEL CELLS HERE**"
            Sheets("Sheet1").Range("A1:E40").Copy        'the cells to copy and paste
            .Paste
            Application.CutCopyMode = False
            .Send
            .Close
        End With
        
        Set NUIdoc = Nothing
        Set NDoc = Nothing
        Set NUIWorkSpace = Nothing
        Set NSession = Nothing
        
    End Sub
    The code works wonderfully for the project I was on at the time, but now I'm trying to change it a bit. What I need it to do now is send an email by referring to a cell that contains a drop-down list. The user will pick the name from the list, and then when they run the macro, it will see which name is selected and send the email. I've tried several things, but none of them have worked.

    The only thing I can think of is to set up a macro for each potential email address, and then have a seperate macro that runs a "call macro" depending on what name is showing in the list. But I'm certain there has to be an easier way.

    Anyone have any ideas? Thanks in advance for any help that is offered.
    Last edited by just_some_guy; 02-04-2011 at 03:51 PM.

Thread Information

Users Browsing this Thread

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

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