#1   Report Post  
 
Posts: n/a
Default Mailmerge Dates

I'm trying to do a mailmerge from Excell and I want the date from excell to
print out as

"st" or "nd" or "rd" or "th" of "month" ", " yyyy


Example. "3rd day of March, 2005"


I have the following function from access. Any help?


' This function formats a date in the formal legal fashion:
' 20th day of February, 2001

Dim strDay As String
Dim strMonth As String
Dim strYear As String

strDay = CStr(Day(dtToday))
strMonth = Format$(dtToday, "mmmm")
strYear = CStr(Year(dtToday))

If Len(Trim(strDay)) = 2 And Left$(strDay, 1) = "1" Then
FormalDate = strDay & "th day of " & strMonth & ", " & strYear
Else
Select Case Right$(strDay, 1)
Case "1"
FormalDate = strDay & "st day of " & strMonth & ", " & strYear
Case "2"
FormalDate = strDay & "nd day of " & strMonth & ", " & strYear
Case "3"
FormalDate = strDay & "rd day of " & strMonth & ", " & strYear
Case Else
FormalDate = strDay & "th day of " & strMonth & ", " & strYear
End Select
End If

End Function

Sincerly,

Greg Smart


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Textboxes in Mailmerge? zSplash Mailmerge 5 March 22nd 05 09:01 PM
Mailmerge Dates Greg Smart Mailmerge 2 March 18th 05 07:27 PM
Tracking Changes - Entering dates of changes Lisa Glase Microsoft Word Help 1 March 3rd 05 10:14 AM
Dates Walt G Microsoft Word Help 3 January 16th 05 10:28 PM
Included Property in Word 2003 MailMerge Alessio Mailmerge 1 December 23rd 04 11:26 AM


All times are GMT +1. The time now is 05:36 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"