Results 1 to 5 of 5
  1. #1
    amangupts is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    43

    HTML body in Access 2007

    Hi,

    I am trying to send an email message through Access 2007 with the use of Outlook 2007. I have used .HTMLBody = "Please find attached Payslip". This part is functioning fine. I am trying to insert Dear Employee Name as header and Regards, Finance Team as Footer. Kindly guide me how to achieve this.

    Secondly is there a way to make a number bold in HTML body? For text we can use <b> and </b> tags. Are there any tags to make a value/number bold in HTML body.



    Thanks in Advance
    Aman

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    1. Your HTML Body needs to use HTML if you want anything other than normal text.

    2. Data can be made bold by using the same tags as you have mentioned.

    3. Assuming you have a form which has the values you want (there can be other methods too but you didn't mention how you were geting the employee Name and such) this is an example:
    Code:
    Dim strBody As String
     
    strBody = "Dear " & Me![Employee Name] & ": <br><br> Please find the attached Payslip. <br><br> The total is <b>" & Me!PayAmount & "</b><br><br>Regards<br><br><br>Finance Team"
     
    .HTMLBody = strBody
    (sorry for all of the <br> as HTML is not my strong suit and I'm sure there is a better way.)

  3. #3
    amangupts is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    43
    Hi,

    Thanks a lot for your help. I am able to achieve what I wanted to. However I am still not able to make the Value bold. I am pasting the code, for your reference. I want Me.Period.Value to get bold (it is basically a combination of month and year as March'2012.

    strBody = "Dear " & Me!EmpNam.Value & ",<br><br><br> Please find attached <b>Payslip</b> for the Month of " & Me.Period.Value & "." & " " & "In case of any discrepancy, kindly report the issue to the <b>Finance Department</b>.<br><br><br>Regards<br><br>Finance Team"

    Kindly help me in getting this field bold.

    Regards,
    Aman

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    strBody = "Dear " & Me!EmpNam.Value & ",<br><br><br> Please find attached <b>Payslip</b> for the Month of <b>" & Me.Period.Value & "</b>." & " " & "In case of any discrepancy, kindly report the issue to the <b>Finance Department</b>.<br><br><br>Regards<br><br>Finance Team"

  5. #5
    amangupts is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    43
    Hi,

    Thanks a lot for all the help. I am able to achieve the exact results with the solutions provided by you.

    Once again thanks a lot.

    Regards,
    Aman

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

Similar Threads

  1. FORMATTING Outlook Email in BODY of Access code
    By taimysho0 in forum Programming
    Replies: 7
    Last Post: 11-28-2011, 11:04 AM
  2. Replies: 0
    Last Post: 05-23-2010, 10:39 PM
  3. Replies: 0
    Last Post: 05-13-2010, 05:18 AM
  4. Access 2003 - Export Report to HTML
    By darth.pathos in forum Import/Export Data
    Replies: 0
    Last Post: 03-20-2010, 01:13 PM
  5. Import HTML files into access
    By mccrimmon in forum Programming
    Replies: 0
    Last Post: 02-15-2010, 03:40 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