How to email errorlog table.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Karl Roes

    #1

    How to email errorlog table.

    Hi all,

    I am after some suggestions on ways to email an errorlog table. I have
    been working on remote interfaces and would like the users to email
    the errorlog back to me at the push of a button when required.

    Regards

    Karl
  • Larry  Linson

    #2
    Re: How to email errorlog table.

    Googling the archive on CDONT, MAPI, and SendObject might be a start on
    e-mailing anything from Access.

    Larry Linson
    Microsoft Access MVP

    "Karl Roes" <karlroes@hotma il.com> wrote in message
    news:7cc66112.0 406241634.29592 2da@posting.goo gle.com...[color=blue]
    > Hi all,
    >
    > I am after some suggestions on ways to email an errorlog table. I have
    > been working on remote interfaces and would like the users to email
    > the errorlog back to me at the push of a button when required.
    >
    > Regards
    >
    > Karl[/color]


    Comment

    • Karl Roes

      #3
      Re: How to email errorlog table.

      Hi Larry,

      Thanks for the pointers. I did have a look at SendObject last night -
      the macro defaulted to Outlook, not Outlook Express. It worked though,
      sent the report ( via Outlook )in both RTF & HTML, just need to look a
      little deeper then have a look at MAPI etc as per your suggestions.

      Thanks for your time.

      Regards

      Karl



      "Larry Linson" <bouncer@localh ost.not> wrote in message news:<DvMCc.266 40$a61.17419@nw rddc01.gnilink. net>...[color=blue]
      > Googling the archive on CDONT, MAPI, and SendObject might be a start on
      > e-mailing anything from Access.
      >
      > Larry Linson
      > Microsoft Access MVP
      >
      > "Karl Roes" <karlroes@hotma il.com> wrote in message
      > news:7cc66112.0 406241634.29592 2da@posting.goo gle.com...[color=green]
      > > Hi all,
      > >
      > > I am after some suggestions on ways to email an errorlog table. I have
      > > been working on remote interfaces and would like the users to email
      > > the errorlog back to me at the push of a button when required.
      > >
      > > Regards
      > >
      > > Karl[/color][/color]

      Comment

      • Karl Roes

        #4
        Email report?...contd

        Hi Larry,

        Well,I have done some searching and this nice little MAPI snippet
        courtesy of Lyle Fairfield does the trick - nice and simple....

        .....courtesy Lyle Fairfield.....

        Option Explicit

        Type MAPIRecip
        Reserved As Long
        RecipClass As Long
        Name As String
        Address As String
        EIDSize As Long
        EntryID As String
        End Type

        Type MAPIFileTag
        Reserved As Long
        TagLength As Long
        Tag() As Byte
        EncodingLength As Long
        Encoding() As Byte
        End Type

        Type MAPIFile
        Reserved As Long
        Flags As Long
        Position As Long
        PathName As String
        FileName As String
        FileType As MAPIFileTag
        End Type

        Type MAPIMessage
        Reserved As Long
        Subject As String
        NoteText As String
        MessageType As String
        DateReceived As String
        ConversationID As String
        Originator As Long
        Flags As Long
        RecipCount As Long
        Recipients As Long
        Files As Long
        FileCount As Long
        End Type

        Declare Function MAPISendMail _
        Lib "c:\program files\outlook express\msoe.dl l" ( _
        ByVal Session As Long, _
        ByVal UIParam As Long, _
        message As MAPIMessage, _
        ByVal Flags As Long, _
        ByVal Reserved As Long) As Long

        Sub SendMailWithOE( ByVal strSubject As String, ByVal strMessage As
        String, ByRef
        aRecips As Variant)
        Dim recips() As MAPIRecip
        Dim message As MAPIMessage
        Dim z As Long
        ReDim recips(LBound(a Recips) To UBound(aRecips) )
        For z = LBound(aRecips) To UBound(aRecips)
        With recips(z)
        .RecipClass = 1
        If InStr(aRecips(z ), "@") <> 0 Then
        .Address = StrConv(aRecips (z), vbFromUnicode)
        Else
        .Name = StrConv(aRecips (z), vbFromUnicode)
        End If
        End With
        Next z
        With message
        .NoteText = strMessage
        .Subject = strSubject
        .RecipCount = UBound(recips) - LBound(aRecips) + 1
        .Recipients = VarPtr(recips(L Bound(recips)))
        End With
        MAPISendMail 0, 0, message, 0, 0
        End Sub

        Sub TestSendMailwit hOE()
        Dim aRecips(0 To 0) As String
        aRecips(0) = "smtp:tomvs@sys pac.com"
        SendMailWithOE "Send Mail Through OE", "Sure, you can, Tom!",
        aRecips
        End Sub

        ...... ......

        Can anyone help with automatically attaching say two reports
        "rptErrors" and "rptLicSpec " using this MAPI format?

        SendObject does make the process of sending a report simple -
        DoCmd.SendObjec t acSendReport, "rptErrors" , acFormatTXT, - but not in
        OE - pity that. :-(

        Now, I read that CDO seems to be all the go - why is it touted as
        being more robust than MAPI which seems to work OK?

        Regards

        Karl


        karlroes@hotmai l.com (Karl Roes) wrote in message news:<7cc66112. 0407112106.4a50 8c1d@posting.go ogle.com>...[color=blue]
        > Hi Larry,
        >
        > Thanks for the pointers. I did have a look at SendObject last night -
        > the macro defaulted to Outlook, not Outlook Express. It worked though,
        > sent the report ( via Outlook )in both RTF & HTML, just need to look a
        > little deeper then have a look at MAPI etc as per your suggestions.
        >
        > Thanks for your time.
        >
        > Regards
        >
        > Karl
        >
        >
        >
        > "Larry Linson" <bouncer@localh ost.not> wrote in message news:<DvMCc.266 40$a61.17419@nw rddc01.gnilink. net>...[color=green]
        > > Googling the archive on CDONT, MAPI, and SendObject might be a start on
        > > e-mailing anything from Access.
        > >
        > > Larry Linson
        > > Microsoft Access MVP
        > >
        > > "Karl Roes" <karlroes@hotma il.com> wrote in message
        > > news:7cc66112.0 406241634.29592 2da@posting.goo gle.com...[color=darkred]
        > > > Hi all,
        > > >
        > > > I am after some suggestions on ways to email an errorlog table. I have
        > > > been working on remote interfaces and would like the users to email
        > > > the errorlog back to me at the push of a button when required.
        > > >
        > > > Regards
        > > >
        > > > Karl[/color][/color][/color]

        Comment

        Working...