Finding formatted date strings in a document (Word2003)

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15591
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Finding formatted date strings in a document (Word2003)

Post by ChrisGreaves »

I found a nifty date-find procedure at StackOverflow.
I needed to search hundreds of documents and manage formatted date strings in each document.

I post this comment because the procedure was crammed with stuff I'd not known/thought of before:-

(1) Dim aaa As Find ((This alone tells you how little I know of VBA (Word2003)))
(2) Debug.Print MonthName(i)
(3) Set aaa = ActiveDocument.Range(Start:=1, End:=1).Find
(4) aaa.Text = "?" & Mid(MonthName(i), 2, 20) & "[ ^t]{1,5}([0-9]{1,2}),[ ^t]{1,5}([0-9]{4})"

Cheers
Chris
There's nothing heavier than an empty water bottle