+ Reply to Thread
Results 1 to 6 of 6

Create a button to Email file using LotusNotes

  1. #1
    Registered User
    Join Date
    11-07-2008
    Location
    PA
    Posts
    33

    Create a button to Email file using LotusNotes

    I would like to create a button that emails the file... the only problem is that we don't run outlook here we use lotusnotes... is this possible?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Use the forum search for "Lotus Notes"
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-07-2008
    Location
    PA
    Posts
    33
    This is the code i'm working with...
    Sub SendNotesMail()
    Dim Email As String, Subj As String, Msg As String
    Dim r As Integer, x As Double
    Dim Maildb As Object, UserName As String, MailDbName As String, DomDbName As String
    Dim stFileName As String
    Dim MailDoc As Object, Session As Object



    Set Session = CreateObject("Notes.NotesSession")
    UserName = Session.UserName
    MailDbName = "mail\" & Mid$(UserName, 4, InStr(1, UserName, " ") - 4) & Mid$(UserName, _
    InStr(1, UserName, " ") + 1, InStr(1, UserName, "/") - InStr(1, UserName, " ") - 1) & ".nsf"
    Set Maildb = Session.GetDataBase("", MailDbName)
    If Maildb.IsOpen = True Then
    Else: Maildb.OpenMail
    End If
    For r = 2 To 4
    Set MailDoc = Maildb.CreateDocument
    MailDoc.Form = "Memo"
    Email = Cells(r, 2)
    Subj = "Your Annual Bonus"
    Msg = ""
    Msg = Msg & "Dear " & Cells(r, 1) & "," & vbCrLf & vbCrLf
    Msg = Msg & "I am pleased to inform you that your annual bonus is "
    Msg = Msg & Cells(r, 3).text & "." & vbCrLf & vbCrLf
    Msg = Msg & "From Just Testing" & vbCrLf
    Msg = Msg & "Test"

    MailDoc.sendto = Email
    'MailDoc.CopyTo = Whomever
    'MailDoc.BlindCopyTo = Whomever
    MailDoc.Subject = Subj
    MailDoc.Body = Msg
    MailDoc.SaveMessageOnSend = True
    MailDoc.PostedDate = Now
    'Wait two seconds before sending keystrokes
    'Application.Wait (Now + TimeValue("0:00:02"))
    'Application.SendKeys "%s"

    On Error GoTo Audi

    Call MailDoc.Send(False)
    Next r
    Set Maildb = Nothing: Set MailDoc = Nothing: Set Session = Nothing
    Exit Sub
    Audi:
    Set Maildb = Nothing: Set MailDoc = Nothing: Set Session = Nothing

    End Sub
    I need to somehow alter this such that it sends the whole worksheet to just one email so it seems possible but i don't know where to start!
    Last edited by asabti; 11-13-2008 at 10:50 AM.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Please use the Edit button to add Code Tags above

  5. #5
    Registered User
    Join Date
    11-07-2008
    Location
    PA
    Posts
    33
    still not getting anywhere with this... i need to create a send button that sends the whole worksheet and my email client is lotus notes

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You will need to be patient until omeone who uses Lotus Notes can help

+ 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