Results 1 to 7 of 7

Thread: Automatic Email for reports

  1. #1
    Guest
    I'm looking to have Acess 2000 to take a report and automaticly email a report at 7:00. Is this possible or is there an easier more logical way of doing this.

    Thank You

    Ken Devorak

  2. #2
    Member
    Join Date
    Sep 2000
    Posts
    34
    Access cannot do this because a database is not an application. Your best bet would be to create an application in VB that does the mailing, then add it to a system schedular.

  3. #3
    New Member
    Join Date
    Sep 2000
    Location
    Jonesboro, Arkansas
    Posts
    5

    Unhappy

    I am attempting to do this also...I am using the MAPI controls with VB. I can get the attachments and such added to the email..but, I am having problems with my address. If i type in the address it will work fine...but If I code the addressee and his address into my app....i get a returned mail message saying that there is no provider for transfer error. Any suggestions?

  4. #4
    Member
    Join Date
    Sep 2000
    Posts
    34
    post the code you are using to create the file. Let's all take a look and see what's up!

  5. #5
    New Member
    Join Date
    Sep 2000
    Location
    Jonesboro, Arkansas
    Posts
    5
    Below is the code i am currently using...Thanks for the help (prematurely!)

    Public Sub Send_File()
    MAPISession1.SignOn
    MAPIMessages1.SessionID = MAPISession1.SessionID
    MAPIMessages1.MsgIndex = -1
    MAPIMessages1.Compose
    MAPIMessages1.RecipDisplayName = "John Doe"
    MAPIMessages1.RecipAddress = "[email protected]"
    MAPIMessages1.RecipType = 1
    MsgBox (MAPIMessages1.RecipCount)
    MAPIMessages1.RecipIndex = 0
    MAPIMessages1.MsgSubject = "Test of the Report"
    MAPIMessages1.MsgNoteText = "i hope this works"
    'MAPIMessages1.AttachmentPathName = m_sFName
    MAPIMessages1.Send True
    MAPISession1.SignOff
    End Sub

  6. #6
    Member
    Join Date
    Sep 2000
    Posts
    34
    I can't see anything funky there. Anyone?

    You might try popping up a message box with the value of
    MAPIMessages1.RecipAddress

    and make sure it is right. You said it works when you prompt for the addy.

    Also, I only noticed one address... Make sure you have both a to and from addy.

    Try poking your nose into http://www.vbcode.com and see if somebody has a routine written up there for download or at least so you can look at how they did it.

  7. #7
    Hyperactive Member rockies1's Avatar
    Join Date
    Jul 1999
    Location
    Stuck at work
    Posts
    375

    Talking

    My experience with MAPI is that it is tempermental...

    Try this:

    Code:
    Private Sub Command1_Click()
        Dim oOutlookApp As Outlook.Application
        Dim oMailItem As Outlook.MailItem
        Dim strHTML As String
        strHTML = "This is an E-mail Test" & _
        "<br><br>" & _
        "<b>PLEASE NOTE:</b> This is only a test" & _
        "<br><br>" & _
        "Visit my website at : <a href='http://alphaprime.mine.nu'>http://alphaprime.mine.nu</a>" & _
        "<br><br>Thank You!!"
        Set oOutlookApp = New Outlook.Application
        Set oMailItem = oOutlookApp.CreateItem(olMailItem)
        Call oMailItem.Recipients.Add("[email protected]")
        oMailItem.Subject = "Test"
        oMailItem.HTMLBody = strHTML
        'oMailItem.Attachments.Add "c:\add an attachment here..."
        oMailItem.Send
        Set oMailItem = Nothing
        Set oOutlookApp = Nothing
    End Sub
    Also, make sure you set your references to include the Microsoft Outlook 98 Object Model...

    In your HTML, where you would normally use quotes (") use ticks (') or it won't work...

    Morgan
    [email protected] - Home
    [email protected] - Work
    Using VB6 SP6 but trying to learn VB2005EE

Posting Permissions

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



Click Here to Expand Forum to Full Width