Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Send html page in email as body (Access97 on win95b)

    I have been asked if I can cause the invoice to be able to be emailed. As my invoice is actually a form (yes I know, naughty naughty) I was thinking, could I code up the body as an html page and then just slot in the relevant information.

    I will be using Helen Feddema's code as follows:

    Sub EmailInvoice()

    Dim appOutlook As New Outlook.Application
    Dim itm As Outlook.MailItem
    Dim strEMailRecipient As String
    Dim strDataSource As String
    Dim strFilePath As String

    strEMailRecipient = "Gem Caldwell"
    'strFilePath = Application.CurrentProject.path & ""
    'strSnapshotFile = strFilePath & "Products.snp"

    'DoCmd.OutputTo objecttype:=acOutputReport, _
    ' objectname:=strReport, _
    ' outputformat:=acFormatSNP, _
    ' outputfile:=strSnapshotFile

    'Create new mail message and attach snapshot file to it
    Set itm = appOutlook.CreateItem(olMailItem)
    With itm
    .To = strEMailRecipient
    .Subject = "Products report you requested"
    .Body = "This file was exported from " & strReport & _
    " on " & Date & "." & vbCrLf & vbCrLf
    .Display
    End With

    End Sub

    I read elsewhere that by changing .Body to .HTMLBody that I could code the body as an html page.

    Is this so, will it work with Access97, is there anything else I need to know?
    "Heading for the deep end"

  2. #2
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send html page in email as body (Access97 on win95b)

    There is a component from Persists Software, called ASPEmail. The free version will do just what you want. You give it a pop3 server, subject, from, etc, and then you can set an HTML tag, so that the body will be displayed as an HTML page. Works like a champ.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: Send html page in email as body (Access97 on win95b)

    Just checking. Will this work with Office97? The site talks about working with asp pages, which I don't have.
    "Heading for the deep end"

  4. #4
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send html page in email as body (Access97 on win95b)

    Yes, it's a .dll. It can be used in anything that allows for an ActiveX .dll. Just set a reference to it, and the word doc instructions should suffice, it's pretty straight forward.

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Send html page in email as body (Access97 on win95b)

    You should keep in mind that some people do not accept html formatted mail as a security measure.
    Charlotte

  6. #6
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: Send html page in email as body (Access97 on win95b)

    Oh, In view of some of Woody's latest posts, I felt that word docs were beginning to be viewed as a bit suss, but maybe they are the better way to go.

    In order to get the above code to work I had to set a reference to outlook 8.0. The person who actually wants this ability is running Outlook Express 6, not Outlook97, what reference needs to set to get it to work?

    We started with office97, got taken over and put on to Lotus, got sold off and had Lotus removed and now some of us have Outlook97 but people with newer machines didn't get outlook loaded and use OE6 now instead.
    "Heading for the deep end"

  7. #7
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Send html page in email as body (Access97 on win95b)

    Unfortunately, I don't think you can set a reference to OE 6, as it doesn't expose any functionallity at all to Automation. I think you will have to resort to MAPI programming to make things work - and I'm not help on that score. Maybe someone else (Drew?) can assist with it?
    Wendell

Posting Permissions

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