Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

E-mailing from Access 97 2

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
When I used to use Access 2.0 with cc:Mail, I could automatically send select queries as Excel spreadsheets.<br>
Access would launch cc:Mail, ask for my password and send the e-mail. Now that I'm using Access 97 and <br>
Lotus Notes, I can no longer do this. Is there a special trick or is it just not possible anymore?
 
I'm not sure if it doesnt work of if I couldnt get it to work. If you look in help for Lotus or cc mail, there are instructions on using the dll for Lotus, instead of the dll for Outlook.<br>
<br>
I tried and didnt get it to work.
 
You should be able to use the MSMAPI control. We have Lotus Notes here and I wrote a VB application that sends e-mail via MSMAPI. Let me know if you want more detail.
 
bitbrain,<br>
<br>
Yes, I would like more detail, please. Also, do I have to be using MS Exchange to use the MSMAPI control?<br>
<br>
Thanks.<br>
<br>
Bob
 
You don't need MS Exchange as far as I know.<br>
<br>
I think there is a middle layer that needs to be set-up for the MS to Lotus link to work. Before getting involved in the VB stuff, try sending a document from a MS product such as Word or Excel. From the File menu, chose Send. See how far you get. In the meantime...<br>
<br>
Make sure you have the MAPI OCX. From Form design, click the "More Controls" button. Scroll down and see if you have "Microsoft MAPI Message Control Version 5.0" & "Microsoft MAPI Session Control Version 5.0" If you don't see them, look for MSMAPI32.OCX on your system. If you find it, register it via Tools / Active X Controls / Register... If you don't find them, see if you can get them :)<br>
<br>
The controls (two) are invisible. Add them to your form. Following are code samples that I have used. Modify them for your needs. MS Help has more info...<br>
<br>
Private Sub FileSizeWarning(strFileName As String, iMaxRecs As Variant)<br>
<br>
' This routine added 1/22/1999 <br>
' The purpose of this routine is to notify IS when the number of records in the control file<br>
' approaches the maximum. IS will need to clean the file out by archiving old records.<br>
' This routine attempts to send e-mail messages to individuals in IS. If the mail functions<br>
' fail for any reason, a message box is displayed instructing the user to notify IS.<br>
<br>
mbSendMode = False ' use TRUE for testing & FALSE for production.<br>
<br>
mbMsgSent = False<br>
mstrSubj = "WARNING! Check Bill Editor File Size"<br>
mstrText = "System generated message from Retro Bill Editor to IS support team:" _<br>
& CRLF & CRLF _<br>
& "The number of records in control file: " & strFileName _<br>
& " is " & iMaxRecs & " and the maximum is " _<br>
& CONTROL_REC_MAX & ", please take appriopriate action" _<br>
& " (i.e. use menu option Administration / Clean up Bill File)." _<br>
& CRLF & CRLF _<br>
& "This message automatically generated by the Retro" _<br>
& " Bill Editor Application. File size limits set in frmOpenDlg.LoadPlanList."<br>
<br>
<br>
On Error Resume Next<br>
<br>
' Establish the mail session using the MAPI Session control<br>
MAPISess.LogonUI = False ' turn user interface off<br>
MAPISess.UserName = "Commercial Lines" ' set the MS Exchange type<br>
MAPISess.SignOn<br>
<br>
If Err &lt;&gt; 0 Then<br>
GoTo MailError<br>
End If<br>
<br>
' Set-up & send e-mail messages using the MAPI message control<br>
<br>
MAPIMess.SessionID = MAPISess.SessionID ' link the message to the session<br>
<br>
' separate messages are sent to the IS team members. If NONE of them get through<br>
' for any reason, a message box is displayed in the error routine.<br>
' This technicque of sending separate messages used because of the limitations in the<br>
' MAPI controls. The receipients must be defined to the user's personal address book.<br>
' It is quite possible that the personal address book will not be populated.<br>
<br>
Call SendMessage(IS_SUPERVISOR)<br>
Call SendMessage(IS_ADMIN1)<br>
Call SendMessage(IS_ADMIN2)<br>
Call SendMessage(IS_ADMIN3)<br>
<br>
MAPISess.SignOff<br>
<br>
If mbMsgSent = False Then<br>
GoTo MailError<br>
End If<br>
<br>
Exit Sub<br>
<br>
MailError:<br>
<br>
MsgBox "Warning! The number of control records is " & iMaxRecs & _<br>
", and is close to reaching the maximum of " & CONTROL_REC_MAX _<br>
& ". Please notify systems support.", _<br>
vbExclamation, "Retro Bill Editor"<br>
<br>
End Sub<br>
<br>
Private Sub SendMessage(strRecip As String)<br>
<br>
MAPIMess.MsgIndex = -1 ' new message<br>
MAPIMess.RecipType = mapToList ' receipient type is "To"<br>
<br>
MAPIMess.RecipDisplayName = strRecip ' e-mail receipient<br>
<br>
MAPIMess.MsgSubject = mstrSubj<br>
MAPIMess.MsgNoteText = mstrText<br>
<br>
MAPIMess.Send (mbSendMode)<br>
<br>
If Err = 0 Then<br>
mbMsgSent = True<br>
End If<br>
<br>
End Sub<br>
<br>

 
Hey bitbrain...you really know your stuff!!! I tried to send a document from Word and got the message "Cannot load Extended MAPI library mapi32.dll". Also, I did a search for MSMAPI32.OCX and came up with zilch. How can I get these files? Were they supposed to have been installed already? My ISD has a habit of installing the bare bones software.<br>
<br>
TIA,<br>
<br>
Bob
 
Found this at access.superexpert:<br><br>Hope it helps!<br><br>You must use OLE Automation and be somewhat familiar with LotusScript's<br>objects. I wrote the following code to create an attachment in a LotusNotes<br>email based on a file path that is passed.<br><br>Sub CreateNotesEmail(fl As String, subj As String)<br>On Error GoTo errln<br>Dim s As Object<br>Dim db As Object<br>Dim doc As Object<br>Dim RTItem As Object<br>Dim obj As Object<br>Dim w As Object<br>Dim curuidoc As Object<br>Set s = CreateObject(&quot;Notes.Notessession&quot;)<br>Set db = s.GETDATABASE(&quot;&quot;, &quot;&quot;)<br>Call db.OPENMAIL<br>Set doc = db.CREATEDOCUMENT<br>Call doc.REPLACEITEMVALUE(&quot;Subject&quot;, subj)<br>'Call doc.REPLACEITEMVALUE(&quot;Body&quot;, &quot;Message&quot;)<br>Set RTItem = doc.CREATERICHTEXTITEM(&quot;Body&quot;)<br>Set obj = RTItem.EMBEDOBJECT(1454, &quot;&quot;, fl, &quot;Statement&quot;)<br><br>On Error GoTo errw<br>Set w = CreateObject(&quot;Notes.Notesuiworkspace&quot;)<br>Set curuidoc = w.EDITDOCUMENT(True, doc, False)<br>AppActivate (&quot;Lotus Notes&quot;)<br>On Error GoTo errln<br>exln:<br>Set w = Nothing<br>Set s = Nothing<br>Exit Sub<br>errw:<br>Call doc.Save(True, True)<br>MsgBox (&quot;The attachment has been created in a new LOTUS NOTES email and<br>saved as a draft.&quot;)<br>GoTo exln<br>errln:<br>MsgBox (&quot;Error &quot; & Err.Number & &quot;: &quot; & Err.Description)<br>Resume exln<br><br>End Sub<br>
 
PutnamUser,<br>You have first hand evidence of the Microsoft Lawsuit.<br>If you buy all Microsoft products from Access to Exchange and Outlook, then e-mailing from Access is a snap. Its one line of code. If you use someone else's products for part of the equation. It doesn’t work.<br><br>Good Luck <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top