Results 1 to 2 of 2
  1. #1
    msoares is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    3

    Aligning email message text when using SendObject

    Anyone know how to align the message text when using SendObject? When I run the below code I get:

    Project ID: 1
    Project Name: Some Name
    ...



    I'd like to get it so the values align under one another (i.e., the "1" lines up directly above the "S" in "Some").

    Code:
     
    DoCmd.SendObject , , , strTo, strCc, , "New Project Approval", _
    "This is a new project that requires your approval before it can be added to the Project Management database." & vbCrLf & vbCrLf & _
    "Project ID: " & Me.ProjectId & vbCrLf & _
    "Project Name: " & Me.ProjectName & vbCrLf & _
    "Status: " & Me.fkStatus & vbCrLf & _
    "Business Owner: " & DLookup("FirstName", "Employees", "EmployeeID = " & Me.fkUserBusOwner) & " " & DLookup("LastName", "Employees", "EmployeeID = " & Me.fkUserBusOwner) & vbCrLf & _
    "Project Manager: " & DLookup("FirstName", "Employees", "EmployeeID = " & Me.fkUserProjManager) & " " & DLookup("LastName", "Employees", "EmployeeID = " & Me.fkUserProjManager) & vbCrLf & _
    "Proj Description:" & Me.ProjectDescription & vbCrLf & _
    "Project Start: " & Me.ProjectBeginDate & vbCrLf & _
    "Target Date: " & Me.ProjectTargetDate & vbCrLf & _
    "% Complete: " & Format(Me.ProjectPctToComplete, "Percent") & vbCrLf & _
    "Size: " & Me.ProjectSizeLKU & vbCrLf & _
    "Impact: " & Me.ProjectImpact & vbCrLf & _
    "Type: " & Me.ProjectType & vbCrLf & _
    "Categorty " & Me.ProjectCategory & vbCrLf & _
    "Group Head: " & DLookup("FirstName", "Employees", "EmployeeID = " & Me.fkUserLendingSvcGrpHd) & " " & DLookup("LastName", "Employees", "EmployeeID = " & Me.fkUserLendingSvcGrpHd) & vbCrLf & vbCrLf & _
    "Project Metrics Estimates:" & vbCrLf & _
    "Budget: " & Format(Me.Budget, "Currency") & vbCrLf & _
    "Cost Reduction: " & Format(Me.[Cost Reduction], "Percent") & vbCrLf & _
    "FTE Benefit: " & Me.FTE_Benefit, True

  2. #2
    jgelpi16 is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    I'm fairly new at sending e-mails in VBA, but what if you sent it using HTML format and used the <P ALIGN="RIGHT"> code in between the "Product ID:" and your variable?

    Code:
    "Project ID: " <P ALIGN="RIGHT"> & Me.ProjectId & </P> vbCrLf & _
    I have no idea if the syntax is correct, but did it make sense?

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

Similar Threads

  1. Replies: 3
    Last Post: 12-28-2010, 04:40 PM
  2. Replies: 1
    Last Post: 11-17-2010, 11:24 AM
  3. Email sent via DoCmd.SendObject
    By silverback in forum Programming
    Replies: 0
    Last Post: 10-29-2009, 06:26 AM
  4. SendObject Message
    By williammarino in forum Forms
    Replies: 4
    Last Post: 10-06-2009, 01:54 AM
  5. Send email using SendObject instruction
    By stecco in forum Access
    Replies: 4
    Last Post: 09-09-2009, 01:55 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
  •  
Other Forums: Microsoft Office Forums