Solved

Need help with HTML Email from Access

Posted on 2014-02-06
7
284 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:laurel25
  • 4
  • 3
7 Comments
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
Comment Utility
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:laurel25
Comment Utility
Awesome!  Thanks!!!!
0
 
LVL 48

Expert Comment

by:Rgonzo1971
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:laurel25
Comment Utility
Thank you for the additional information!!!
0
 
LVL 48

Expert Comment

by:Rgonzo1971
Comment Utility
You're welcome
0
 

Author Comment

by:laurel25
Comment Utility
Is there a way to issue you additional points for the extra info?  If so, I'd like to do so!
0
 
LVL 48

Expert Comment

by:Rgonzo1971
Comment Utility
You could open a new question

and then I could answer it

Regards
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now