Results 1 to 2 of 2

Thread: Email Report

  1. #1
    Join Date
    Jul 2002
    Posts
    35

    Unanswered: Email Report

    I have a command button that I added to a form that emails a report.

    Is there anyway that I can have the report be in the body of the email and not as an attachement?

    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    88
    Well, I played around with doing this in Lotus Notes and managed to do a COPY to the Clipboard and then PASTED it into the Body of the Lotus Note all in code. Are you using Outlook? Here's the code I used for Lotus Notes, notice that I flipped into Word to execute the COPY.

    DoCmd.OutputTo acOutputReport, XObject, "Rich Text Format", "C:\Dummy.rtf"
    If RtfToClipboard() = False Then
    MsgBox "Send failed -......
    Exit Function
    End If
    ........ Open Notes session
    Call notesDoc.GOTOFIELD("Body")
    Call notesDoc.Paste

    Public Function RtfToClipboard() As Boolean
    On Error GoTo Err_RtfToClipBoard
    RtfToClipboard = False
    Dim appWord As Object
    Dim docReport As Object
    Dim docLocn As String
    docLocn = "C:\Dummy.rtf"
    Set appWord = CreateObject("Word.Application")
    appWord.Visible = True
    Set docReport = appWord.Documents.Open(docLocn)
    appWord.Activate
    appWord.PrintPreview = True
    docReport.Select
    appWord.Selection.Copy
    docReport.Close False
    Set docReport = Nothing
    appWord.Quit
    Set appWord = Nothing
    RtfToClipboard = True
    Exit Function

    Err_RtfToClipBoard:
    Exit Function
    End Function
    Last edited by ingineu; 07-21-03 at 03:05.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •