Solved

Need help with HTML Email from Access

Posted on 2014-02-06
7
287 Views
Last Modified: 2014-02-06
We're trying to create an automated email from an Access 2003 database and can't get the date in the email formatted the way we'd like.  We want the dates in the email to be formatted like this - Tuesday, Jan. 30 or something close to that.  I've attached the email as it currently is created and the code is below.  Any help with this would be greatly appreciated.


With CreateObject("Outlook.Application").CreateItem(0)
        .to = "renatewiegert@lakewoodhealthsystem.com"
        .Subject = "New Hire - " & Me.Parent.First & " " & Me.Parent.Last & "  "
        ' Set body format to HTML
'        .BodyFormat = 2
        ' Format the message
        .HTMLbody = _
            "<html><font face = Arial>"  & _
                "<b>" & _
                "New Hire: " & "</b>" & " " & Me.Parent.First & " " & Me.Parent.Last & "" & "<br><br>" & _
                "<b>" & _
                "Position/Dept: " & "</b>" & " " & Me.Parent.Position & " " & Me.Parent.Dept & "" & "<br><br>" & _
                "<b>" & _
                "Manager: " & "</b>" & " " & Me.Parent.Mgr & " " & "<br><br>" & _
                "<b>" & _
                "Pre-employment Date: " & "</b>" & " " & Me.DS_date & " " & "<br><br>" & _
                "<b>" & _
                "&nbsp &nbsp &nbsp &nbsp &nbsp Drug Screen: " & "</b>" & " " & Me.DS_time & " " & "<br>" & _
                "<b>" & _
                "&nbsp &nbsp &nbsp &nbsp &nbsp PT Screen: " & "</b>" & " " & Me.PT_time & " " & "<br>" & _
                "<b>" & _
                "&nbsp &nbsp &nbsp &nbsp &nbsp EH Paperwork: " & "</b>" & " " & Me.EH_pwtime & " " & "<br>" & _
                "<b>" & _
                "&nbsp &nbsp &nbsp &nbsp &nbsp HR Paperwork: " & "</b>" & " " & Me.HR_pwtime & " " & "<br><br>" & _
                "<b>" & _
                "START/ Dept Orientation: " & "</b>" & " " & Me.Start_date & " " & "<br><br>" & _
                "<b>" & _
                "Link - Emp - Orientation Workspace: " & "<a href=""" & "http://vappmoss/sites/LakeNet/workingatlhs/default.aspx" & """>" & "click Here" & "</a > " & "<br><br>" & "Link - Emp - Orientation Checklist: " & "<a href=""" & "http://vappmoss/sites/LakeNet/Supervisor/Supervisor Forms/Orientation/Department Orientation Checklist.doc" & """>" & "Department Orientation Checklist" & "</a > " & "<br><br>" & _
                "General Orientation: " & "</b>" & " " & Me.GO_day2 & " " & "<br><br>" & _
                "VIP: " & "</b>" & " " & Me.VIP_assg & " " & "<br>" & _
                "</html>"
        ' Display Email
        .display
        SendKeys "^+{END}", True
        SendKeys "{END}", True
        SendKeys "{END}", True
        SendKeys "{Enter}", True
        SendKeys "%ng{enter}", True 'equivalent to Alt iNsert siGnature ENTER for default signature   
      End With

Open in new window

New-Hire-Email--.msg
0
Comment
Question by:Laurel Buchanan
  • 4
  • 3
7 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39839392
Hi,

Try to replace your dates

with
Format(YourDate, "dddd, mmm. dd")

Open in new window


eg.
Format(Me.DS_date, "dddd, mmm. dd") 

Open in new window

Regards
0
 

Author Closing Comment

by:Laurel Buchanan
ID: 39839410
Awesome!  Thanks!!!!
0
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 39839443
Hi,

to insert the signature if you already have it automatically

is to display first, read the signature and add it to your text

.Display
signature = .HTMLBody
.HTMLBody = "Your Text" & vbNewLine & signature 

Open in new window

Regards
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:Laurel Buchanan
ID: 39839452
Thank you for the additional information!!!
0
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 39839461
You're welcome
0
 

Author Comment

by:Laurel Buchanan
ID: 39839531
Is there a way to issue you additional points for the extra info?  If so, I'd like to do so!
0
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 39839601
You could open a new question

and then I could answer it

Regards
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question