Results 1 to 3 of 3

Automated Email Truncating Message Body

  1. #1
    sirhacksalot is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2013
    Posts
    2

    Automated Email Truncating Message Body

    I have pieced together a macro that takes data from a query to populate and send an automatic outlook message based on a customer table and template table. The template table has an EmailBody field of type Memo that is merging with the customer table to formulate the EmailBody field for each customer in the query. However, when the email sends through Outlook it always truncates it to 255 legible characters and then adds a few foreign characters in at the end - never including the whole message. Any suggestions?

    Code:
    Dim db As DAO.Database
    Dim rst As DAO.Recordset
    Set db = CurrentDb
    Set rst = db.OpenRecordset("SELECT * FROM tblCustomer WHERE CustomerID=" & lngCustomerID)
    rst.MoveFirst
    XXXTitleXXX = Nz(rst!Title, "")
    XXXFirstNameXXX = Nz(rst!FirstName, "")
    XXXLastNameXXX = Nz(rst!LastName, "")
    XXXrFirstNameXXX = Nz(rst!rFirstName, "")
    XXXrLastNameXXX = Nz(rst!rLastName, "")
    XXXExpiredDateXXX = Nz(rst!ExpiredDate, "")
    rst.Close
    Set rst = Nothing
    Set db = Nothing
    End Function
    
    
    Sub ExpirationSub()
    Dim db As DAO.Database
    Dim rst As DAO.Recordset
    Dim rs As DAO.Recordset
    Dim objMessage
    Set db = CurrentDb
    Set rst = db.OpenRecordset("SELECT * FROM qrySubscriptionDue WHERE Says < 90")
    On Error Resume Next
    'Get Outlook if it's running
    Set oApp = GetObject(, "Outlook.Application")
    If Err <> 0 Then
         'Outlook wasn't running, start it from code
         Set oApp = CreateObject("Outlook.Application")
         Started = True
    End If
    Do While Not rst.EOF
    Set oItem = oApp.CreateItem(olMailItem)
     With oItem
        .BodyFormat = olFormatHTML
        .To = rst!EmailAddress
        .Subject = "PLEASE READ: Impending Resource Expiration Notification"
        .Body = rst!EmailBody
        .Importance = olImportanceHigh
         'Send the email
        .Send
     End With
    rst.MoveNext
    Loop
    rst.Close
    Set rst = Nothing
    Set db = Nothing
    Set oItem = Nothing
    If Started Then
        oApp.Quit
    End If
    
    End Sub

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    10,914
    Any of these issues apply: http://allenbrowne.com/ser-63.html
    (RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 Pro - acXP, ac07, ac10, ac13
    If your issue is resolved...go ahead and use the Thread Tools at the top of the thread and mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  3. #3
    sirhacksalot is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2013
    Posts
    2
    Quote Originally Posted by RuralGuy View Post
    Any of these issues apply: http://allenbrowne.com/ser-63.html
    That resource was very helpful - I appreciate it. However, I read through everything and checked many of the settings it suggested and nothing needed to be changed. I also ready a number of the articles that were linked at the bottom of the page but didn't see any that applied when I read the Symptoms section of the linked articles.

    Would you be able to help me any further on this? It is crucial that the text in that memo field is included in the email being sent as I have coded for automatic replies being processed from the body of the return emails. The memo field shows the full correct text in the query field so it is happening I guess when the message is being created.

    Thanks for your time!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 08-03-2012, 01:26 PM
  2. Email report as body of email (RTF)
    By TheDeceived in forum Programming
    Replies: 4
    Last Post: 07-23-2012, 05:39 AM
  3. Email report as body of email
    By chrish20202 in forum Programming
    Replies: 6
    Last Post: 01-15-2012, 05:23 PM
  4. Replies: 1
    Last Post: 05-23-2011, 07:07 AM
  5. Email from report to Email body
    By Ehmke66 in forum Programming
    Replies: 4
    Last Post: 01-03-2011, 11:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums