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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Access into Lotus Notes

Status
Not open for further replies.

Djbell

IS-IT--Management
Apr 22, 2002
175
GB
Hi All

I have an Access 97 database that creates a report based on a query. I would like to add functionality so that users can email this report to the correct user. Unfortuantly we use Lotus Notes. How can I get the information automatically into the body of a Lotus Notes mail without being created as an attachment.

I have the following code on a button click.

Dim stDocName As String
stDocName = "Email Report"
DoCmd.SendObject acReport, stDocName, acFormatHTML, "john.doe@somewhere.com", , , "You have a new report"

This works sometimes by inserting the report directly into the lotus notes email, but other times it attaches it as an excel document, which I can not figure out.

Any help is appreciated.

Regards

Douglas Bell
 
My experience is that mailing to Lotus or Exchange using Outlook appears to function about the same. The Send Object function uses whatever is the default e-mail client on the PC. However I have noticed that there is a limited amount of text that can be inserted into the body of the e-mail. It appears as if the text gets truncated at about 1.5 lines. I can insert live data into the subject of message body, but only limited amounts.

Here are the functions I call to e-mail a work request to an IT staff and to e-mail completion to the original requester...

Option Compare Database
Function basWOITEMail()
On Error GoTo basWOITEMail_Err

' Refresh record
DoCmd.RunCommand acCmdRefresh
If (Eval("[Forms]![frmWorkOrders]![WOITStaff] Is Null")) Then
' If it work order staff is empty, give error message, go back to it staff
Beep
MsgBox "Please Enter An IT Staff", vbInformation, "Assigning An IT Staff Is Required"
DoCmd.CancelEvent
DoCmd.GoToControl "[WOITSatff]"
Exit Function
End If
' Send an e-mail to the it staff
DoCmd.SendObject acReport, "rptWOEMail", "RichTextFormat(*.rtf)", Forms!frmWorkOrders!WOITStaff.Column(2), "", "", "Work order number " & Forms!frmWorkOrders!WONumber & " has been assigned to you. The request was received at " & Forms!frmWorkOrders!RequestDate, "Your friendly IT Tracking System!", False, ""

basWOITEMail_Exit:
Exit Function

basWOITEMail_Err:
MsgBox Error$
Resume basWOITEMail_Exit

End Function


Function basWOReqEmail()
On Error GoTo basWOReqEmail_Err

' Refresh record
DoCmd.RunCommand acCmdRefresh
If (Eval("[Forms]![frmWorkOrders]![CompleteDate] Is Null")) Then
' If complete date is empty, give error message, go back to complete date
Beep
MsgBox "Please Enter A Completion Date", vbInformation, "The Work Order Must Be Complete In Order To Email The Requester"
DoCmd.CancelEvent
DoCmd.GoToControl "[CompleteDate]"
Exit Function
End If

If (Eval("[Forms]![frmWorkOrders]![EOCID] Is Null")) Then
' If requester is empty, give error message, go back to requester
Beep
MsgBox "Please Enter A Requester", vbInformation, "Assigning A Requester Is Required"
DoCmd.CancelEvent
DoCmd.GoToControl "[EOCID]"
Exit Function
End If
' Send an e-mail to the requester
DoCmd.SendObject acReport, "rptWOEMailComp", "RichTextFormat(*.rtf)", Forms!frmWorkOrders!EOCID.Column(3), "", "", "The IT Work Request that you submitted has been completed", "Please see the attached document for details on your IT Work Request.", False, ""


basWOReqEmail_Exit:
Exit Function

basWOReqEmail_Err:
MsgBox Error$
Resume basWOReqEmail_Exit

End Function

As you can see, I am including some live data, but the bulk of the information is being put into a report and e-mailed as a word rtf document.

I tried including a lot more information in the body of the message but it always is truncated at about 1.5 lines. I am not sure if this is a limit of the Send Object function?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top