+ Reply to Thread
Results 1 to 3 of 3

Send Excel attachment via Lotus Notes

  1. #1

    Send Excel attachment via Lotus Notes

    I have a routine which I have used frequently (and obtained from this
    group) to send mail from Excel to Lotus Notes. This works extremely
    well and is shown below:

    Sub send2()

    Dim s As Object
    Dim db As Object
    Dim doc As Object
    Dim nSession

    Set s = CreateObject("Notes.NotesSession")
    Set db = s.GetDatabase(" ", "mail\username.nsf")
    Set doc = db.createdocument()
    doc.form = "Memo"
    doc.sendTo = "[email protected]"
    doc.Subject = " Send email to Notes"
    'doc.body = " This works well"
    Call doc.Send(False)
    Set nSession = Nothing
    End Sub

    I now want to adapt this routine to send an Excel file attachment and
    so I have added the following lines to my script:

    Sub send2()

    Dim s As Object
    Dim db As Object
    Dim doc As Object
    Dim nSession
    Dim eo As Object
    Dim rtf As Object
    Dim attachment As String

    Set s = CreateObject("Notes.NotesSession")
    Set db = s.GetDatabase(" ", "mail\username.nsf")
    Set doc = db.createdocument()
    doc.form = "Memo"
    doc.sendTo = "[email protected]"
    doc.Subject = " Sending attachments through Notes"
    'doc.body = " This doesn't work well"

    '********************************************************************
    'these are the new lines
    attachment = "C:\TEMP\FaceID.xls"
    Set rtf = doc.CreateRichTextItem("Attachment")
    Set eo = rtf.EmbedObject(1454, "", attachment, "Attachment")
    '***********************************************************************
    Call doc.Send(False)
    Set nSession = Nothing
    End Sub

    Stepping through the script at the line,
    Set eo = rtf.EmbedObject(1454, "", attachment, "Attachment"),

    I get a Notes run-time error 7067 message which says "Cannot write or
    create file (file or disk is read-only). Needless to say the file or
    disk is not read-only and I have tried attaching a number of different
    workbooks.

    Anybody any ideas what I've done wrong or how I might correct this
    please?
    Thank you in anticipation of your help.

    Simon


  2. #2
    Ron de Bruin
    Guest

    Re: Send Excel attachment via Lotus Notes

    See this site for example code

    Sending mail from Lotus Notes (XL-Dennis)

    http://www.excelkb.com/?cNode=1X5M7A




    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    <[email protected]> wrote in message news:[email protected]...
    >I have a routine which I have used frequently (and obtained from this
    > group) to send mail from Excel to Lotus Notes. This works extremely
    > well and is shown below:
    >
    > Sub send2()
    >
    > Dim s As Object
    > Dim db As Object
    > Dim doc As Object
    > Dim nSession
    >
    > Set s = CreateObject("Notes.NotesSession")
    > Set db = s.GetDatabase(" ", "mail\username.nsf")
    > Set doc = db.createdocument()
    > doc.form = "Memo"
    > doc.sendTo = "[email protected]"
    > doc.Subject = " Send email to Notes"
    > 'doc.body = " This works well"
    > Call doc.Send(False)
    > Set nSession = Nothing
    > End Sub
    >
    > I now want to adapt this routine to send an Excel file attachment and
    > so I have added the following lines to my script:
    >
    > Sub send2()
    >
    > Dim s As Object
    > Dim db As Object
    > Dim doc As Object
    > Dim nSession
    > Dim eo As Object
    > Dim rtf As Object
    > Dim attachment As String
    >
    > Set s = CreateObject("Notes.NotesSession")
    > Set db = s.GetDatabase(" ", "mail\username.nsf")
    > Set doc = db.createdocument()
    > doc.form = "Memo"
    > doc.sendTo = "[email protected]"
    > doc.Subject = " Sending attachments through Notes"
    > 'doc.body = " This doesn't work well"
    >
    > '********************************************************************
    > 'these are the new lines
    > attachment = "C:\TEMP\FaceID.xls"
    > Set rtf = doc.CreateRichTextItem("Attachment")
    > Set eo = rtf.EmbedObject(1454, "", attachment, "Attachment")
    > '***********************************************************************
    > Call doc.Send(False)
    > Set nSession = Nothing
    > End Sub
    >
    > Stepping through the script at the line,
    > Set eo = rtf.EmbedObject(1454, "", attachment, "Attachment"),
    >
    > I get a Notes run-time error 7067 message which says "Cannot write or
    > create file (file or disk is read-only). Needless to say the file or
    > disk is not read-only and I have tried attaching a number of different
    > workbooks.
    >
    > Anybody any ideas what I've done wrong or how I might correct this
    > please?
    > Thank you in anticipation of your help.
    >
    > Simon
    >




  3. #3

    Re: Send Excel attachment via Lotus Notes

    Thank you Ron. I found a routine I was able to adapt successfully.

    Simon


+ Reply to Thread

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