Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / March 2005

Tip: Looking for answers? Try searching our database.

Mailmerge Dates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg Smart - 18 Mar 2005 15:44 GMT
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
Charles Kenyon - 18 Mar 2005 18:46 GMT
It will depend on whether Word recognizes the result as a date. The
following would give the result you want on a DATE field. You could try it
with your mergefield date and see what happens.

{ Date \@ "d" \* ordinal } would give you 18th today.

So try { MergeField Date \@ "d" \* ordinal } and see what happens.

See http://addbalance.com/word/datefields1.htm for more on formatting date
fields to get the rest of your date if the above works. Please let me know.
Signature

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> I'm trying to do a mailmerge from Excell and I want the date from excell
> to
[quoted text clipped - 37 lines]
>
> Greg Smart
gregory.smart@us.army.mil - 18 Mar 2005 20:26 GMT
That's got it! - Thanks.

> It will depend on whether Word recognizes the result as a date. The
> following would give the result you want on a DATE field. You could try it
[quoted text clipped - 47 lines]
> >
> > Greg Smart
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.