Automatic date formatting?

E

Eva Whitley

I'm editing a document where the date is given in the MM/DD/YYYY
format. Our style guidelines call for the MMMM D, YYYY style in the
body text format, but the MM/DD/YYYY style in table cell text format.

I am looking for a quick and easy fix that would find dates in body
text format, and automatically change them to the right format.

I tried a number of search terms in Google Groups to find a solution
to this, for surely I am not the first person to want this. I found a
number of references to setting the default date format, which would
be find in the documents I write, but doesn't seem to help with
documents other people write.

Am I searching for the impossible? Has someone written a macro that
would cover this? I'd appreciate any help the Word mavens here could
give me, and I'll keep checking back to check for possible solutions.

Thanks in advance--Eva Whitley
 
F

Fay Yocum

Are the dates entered as fields? If they are try Selection the whole
document. Press Shift+F9 to display the code. Open the Replace dialog box,
Ctrl+H. I copied the code that is currently there in placed it in the Find
window of the dialog box, exclude the {}s. Make sure you don't capture any
extra spaces. Paste it in the replace box and modify. Then see what happens.
Note when I typed in the code in the dialog box it didn't work, but if I
pasted from the original it worked for me. It probably has something to do
with it being a field. If that works for you create a macro. Lets us know if
that works.

Fay
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Eva,

The following code in a macro will do what you want:

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[0-9]{2}/[0-9]{2}/[0-9]{4}",
MatchWildcards:=True, Wrap:=wdFindStop, Forward:=True) = True
If Selection.Information(wdWithInTable) = False Then
Selection.Range.Text = Format(Selection.Range.Text, "MMMM d,
yyyy")
Else
Selection.Collapse wdCollapseEnd
End If
Loop
End With


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
S

Suzanne S. Barnhill

Andre, this does not even approach being an answer to the current question.
Why don't you sit back and read answers for a while instead of posting them?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
A

Andre Da Costa

Go to "Insert > Date & Time > (under "Available formats:", choose the date
format you want to be displayed.

At the bottom, left corner of the "Data and Time" dialogue, click the
"Default" button and click ok.

Andre Da Costa
Jamaica W.I.
 
M

Michael

Andre, this does not even approach being an answer to the curren
question.
This was okay Suzanne...you should have left it at that.
Why don't you sit back and read answers for a while instead of postin
them?
This was not okay! It is rude, abrasive, and combative. Why do yo
think you have the right embarrass people in a public forum?

Andre was only trying to help and probably didn't read the question a
closely as he should have, but is that reason enough to embarrass him
Did your mother ever tell you, when you were a little girl, "If yo
don't have something nice to say, don't say anything at all".

Nice try Andre
 
T

TF

Michael

Well if you read through these Newsgroups you will see that the poster has
posted dozens of answers a day, mostly are completely wrong. We have
politely asked him to stop but he continues posting garbage. Patience
doesn't come from a bottomless pit.


--
Terry Farrell - Word MVP
http://word.mvps.org/


:
: > Andre, this does not even approach being an answer to the current
: > question.
: This was okay Suzanne...you should have left it at that.
:
: > Why don't you sit back and read answers for a while instead of posting
: > them?
: This was not okay! It is rude, abrasive, and combative. Why do you
: think you have the right embarrass people in a public forum?
:
: Andre was only trying to help and probably didn't read the question as
: closely as he should have, but is that reason enough to embarrass him?
: Did your mother ever tell you, when you were a little girl, "If you
: don't have something nice to say, don't say anything at all".
:
: Nice try Andre!
:
:
: ------------------------------------------------
:
:
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top