Excel sheet to Notes r5

robhargreaves

Board Regular
Joined
Feb 6, 2005
Messages
85
I have been trying to get sendmail from excel to work with lotus notes

I have thought about trying to use a mailto: but cant think how to do it. I can get it to work in Outlook no problem but we use Lotus Notes r5 at work.

My button in excel to outlook allows me to click, create a seperate excel file with that specific worksheet only placed in it. I use

Code:
.Cells.Copy
        .Cells.PasteSpecial Paste:=xlPasteValues

to only get values not formula.

The new file is called by worksheetname.xls

The Outlook message is addressed and headed in the code also the new file is attached to the email.

This is exactly what I wish to do with notes - is it possible?

By the way the user will be logged in to notes and it will be open.

Thanks for your help.

Rob
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Here's NateO's code for using Lotus Not(s) with Excel:
Code:
Sub LotusNots()
  ' Declare Variables for file and macro setup

    Dim UserName As String
    Dim MailDbName As String
    Dim Maildb As Object
    Dim MailDoc As Object
    Dim AttachME As Object
    Dim Session As Object
    Dim EmbedObj1 As Object

    With Application
        .ScreenUpdating = False
        .DisplayAlerts = False

      ' Open and locate current LOTUS NOTES User
    
        Set Session = CreateObject("Notes.NotesSession")
            UserName = Session.UserName
        MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
        Set Maildb = Session.GETDATABASE("", MailDbName)
        If Maildb.IsOpen = True Then
        Else
            Maildb.OPENMAIL
        End If
    
      ' Create New Mail and Address Title Handlers
    
        Set MailDoc = Maildb.CreateDocument
    
        MailDoc.Form = "Memo"
        '   Select range of e-mail addresses
        Recipient = Sheets("E-Mail Addresses").Range("A2").Value
        MailDoc.SendTo = Recipient
        
        ans = MsgBox("Would you like to Copy (cc) anyone on this message?" _
            , vbQuestion & vbYesNo, "Send Copy")
        
            If ans = vbYes Then
                ccRecipient = InputBox("Please enter the additional recipient's e-mail address" _
                    , "Input e-mail address")
                MailDoc.CopyTo = ccRecipient
            End If
                
        MailDoc.Subject = "Pending Report"
            MailDoc.Body = _
        "Attached is a Pending Report.  Please acknowledge receipt."
    
    '   Select Workbook to Attach to E-Mail
    
        MailDoc.SaveMessageOnSend = True
            attachment1 = "C:\YourFile.xls" '    Required File Name
    
        If attachment1 <> "" Then
            On Error Resume Next
                Set AttachME = MailDoc.CREATERICHTEXTITEM("attachment1")
                Set EmbedObj1 = AttachME.embedobject(1454, "attachment1", "C:\YourFile.xls", "") 'Required File Name
            On Error Resume Next
        End If
    
        MailDoc.PostedDate = Now()
            On Error GoTo errorhandler1
        MailDoc.Send 0, Recipient
    
        Set Maildb = Nothing
            Set MailDoc = Nothing
                Set AttachME = Nothing
            Set Session = Nothing
        Set EmbedObj1 = Nothing
    
errorhandler1:
    
        Set Maildb = Nothing
            Set MailDoc = Nothing
                Set AttachME = Nothing
            Set Session = Nothing
        Set EmbedObj1 = Nothing
    
        .ScreenUpdating = True
        .DisplayAlerts = True
    End With
    
End Sub
Hope that helps,

Smitty
 
Upvote 0

Forum statistics

Threads
1,224,829
Messages
6,181,222
Members
453,024
Latest member
Wingit77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top