Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.
Dim Maildb As Object 'The mail database Dim UserName As String 'The current users notes name Dim MailDbName As String 'THe current users notes mail database name Dim MailDoc As Object 'The mail document itself Dim AttachME As Object 'The attachment richtextfile object Dim Session As Object 'The notes session Dim EmbedObj As Object 'The embedded object (Attachment) 'Dim Subject As String 'Dim Attachment As String 'Dim Recipient As String 'Dim BodyText As String Dim SaveIt As Boolean Dim DB As DAO.Database Dim strSql As String Dim strRecipient As String Dim recipient(5) As Variant Dim rstRecipient As Recordset Set DB = CurrentDb 'Start a session to notes Set Session = CreateObject("Notes.NotesSession") UserName = Session.UserName 'Attachment = strAttachment 'Recipient = strRecipient 'BodyText = strBodyText 'Subject = strSubject SaveIt = "True" 'Next line only works with 5.x and above. Replace password with your password 'Session.Initialize ("biomerieux") 'Get the sessions username and then calculate the mail file name 'You may or may not need this as for MailDBname with some systems you 'can pass an empty string or using above password you can use other mailboxes. MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf" 'Open the mail database in notes Set Maildb = Session.GETDATABASE("", MailDbName) If Maildb.ISOPEN = True Then 'Already open for mail Else Maildb.OPENMAIL End If strSql = "Select * from tbl_Old_Dates_email" Set rstRecipient = DB.OpenRecordset(strSql, dbOpenDynaset)
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
10 Experts available now in Live!