Results 1 to 2 of 2
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

    Text formatting in email

    With this code I get some lines that don't quite react the way I want it to. The output is generally the way I want it.



    Code:
    strBdyMail = strBdyMail & "Date Issue Identified: " & Chr(9) & Chr(9) & [Dates] & Chr(9) & Chr(9) & "Days Open:" & Chr(9) & DaysOpen & vbCrLf & vbCrLf _
                 & "Priority: " & Chr(9) & Chr(9) & Chr(9) & P1 & vbCrLf _
                 & "CR Number: " & Chr(9) & Chr(9) & Chr(9) & OOBNumber & vbCrLf & vbCrLf _
                 & "AO Recommendation: " & Chr(9) & Chr(9) & AOVote & vbCrLf _
                 & "O6 Recommendation: " & Chr(9) & Chr(9) & O6Vote & vbCrLf & vbCrLf _
                 & "Change Requested: " & Chr(9) & Chr(9) & [ChangeRequested] & vbCrLf & vbCrLf _
                 & "Unit & Section: " & Chr(9) & Unitss & vbCrLf _
                 & "MTOE Para & Bumper: " & Chr(9) & Chr(9) & [MTOEParass] & vbCrLf & vbCrLf _
                 & "Rationale: " & Chr(9) & Chr(9) & Rationale & vbCrLf & vbCrLf _
                 & "Notes: " & Chr(9) & Chr(9) & Chr(9) & NOTES & vbCrLf _
                 & "Action Items: " & Chr(9) & Chr(9) & ActionItem & vbCrLf _
                 & "__________________________________________________________________________" & vbCrLf & vbCrLf
    For example with this code may have a length that will wraparound: & "Notes: " & Chr(9) & Chr(9) & Chr(9) & NOTES & vbCrLf _

    What I get:

    Notes:Tab.....Tab.....nxewuhdwehffchqiheiferwqhdui weqfuiwefiewfuwhfiewh
    xioqwjndiwnfoew

    What I want

    Notes:Tab.....Tab.....nxewuhdwehffchqiheiferwqhdui weqfuiwefiewfuwhfiewh
    tab.....Tab.....Tab.....xioqwjndiwnfoew

    Its being nitpicky I know.

    Any suggestions?

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    Maybe figure out how many characters each Notes line can have, then break it up. You will need to check for spaces so break is not in middle of a word.

    'Lets say you you can put 20 characters on each Notes line and total character in Notes value is 30 characters.

    FullLen = Len(Me.Notes)
    EndLine1 = (InStrRev(Left(Me.Notes, 20), " ") - 1)
    EndLine2 = (InStrRev(Mid(Me.Notes, EndLine1 + 2, FullLen), " ") - 1)

    If FullLen > 20 Then
    Line1 = Left(Me.Notes, EndLine1)
    Line2 = Mid(Me.Notes, EndLine1 + 2, FullLen)
    Else
    Line = Me.Notes
    End If

    Not sure if all that is accurate but should be able to break the Notes up like that.

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

Similar Threads

  1. Formatting Issue Email Body Text
    By Mick99 in forum Access
    Replies: 1
    Last Post: 09-07-2015, 08:53 PM
  2. Trouble Formatting Outlook Email from Access
    By Nuke1096 in forum Access
    Replies: 6
    Last Post: 11-07-2013, 03:07 PM
  3. Replies: 3
    Last Post: 02-07-2013, 09:53 PM
  4. Replies: 7
    Last Post: 10-11-2012, 02:13 PM
  5. Sending datasheet to email loses formatting
    By Kristeen Boyd in forum Import/Export Data
    Replies: 3
    Last Post: 08-29-2012, 05:31 PM

Posting Permissions

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