gyommaui said:
I am merging datas from Act into Word 2002. The date comes out
as 20031126. How do I get it to give me a Friday, November 26, 2003.
I think I have tried everything that as recommended on this forum
without much success, format never changed.
Thanks
I may be wrong, but I don't think there's any way to get that result
from a field. Assuming all the dates come in as 8-digit numbers (that
is, if the month or day is one digit, it has a leading zero as in
20030507), you can run this macro after the merge to convert the
dates:
Sub ReformatDate()
Dim rgOriginalDate As Range
Dim strTemp As String
Set rgOriginalDate = ActiveDocument.Range
With rgOriginalDate.Find
.ClearFormatting
.Text = "<[0-9]{8}>"
.MatchWildcards = True
.Format = False
.Forward = True
.Wrap = wdFindStop
Do While .Execute
strTemp = rgOriginalDate.Text
strTemp = Mid(strTemp, 5, 2) & "/" & _
Right(strTemp, 2) & "/" & Left(strTemp, 4)
If IsDate(strTemp) Then
rgOriginalDate.Text = _
Format(strTemp, "dddd, MMMM dd, yyyy")
rgOriginalDate.Collapse wdCollapseEnd
End If
Loop
End With
End Sub