Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need help with HTML Email from Access

Posted on 2014-02-06
7
Medium Priority
?
315 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 53

Accepted Solution

by:
Rgonzo1971 earned 2000 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 53

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

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

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 53

Expert Comment

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

and then I could answer it

Regards
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

773 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