C
Co
Hi All,
I want to search word documents for a date in the text. Since the
documents all have different formats I can't search for a dedicated
word like: " Date: ".
So I created a loop that searches for all months something like:
Dim sMS as String
Dim aM() as String
sMS = "JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC"
aM = Split(sMS,",")
For i = 0 To 11
search in Word document for aM(i)
if found select whole date
try te resolve string as real date
Next
Normally the date I want is somewhere at the top of the document.
However when this is for example AUG
and somewhere in the text it finds FEB it will take that date instead
of the date at the top I really want.
because it first searches for FEB and later on for AUG.
How can I change this so that the right date will be found.
Regards
Marco
I want to search word documents for a date in the text. Since the
documents all have different formats I can't search for a dedicated
word like: " Date: ".
So I created a loop that searches for all months something like:
Dim sMS as String
Dim aM() as String
sMS = "JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC"
aM = Split(sMS,",")
For i = 0 To 11
search in Word document for aM(i)
if found select whole date
try te resolve string as real date
Next
Normally the date I want is somewhere at the top of the document.
However when this is for example AUG
and somewhere in the text it finds FEB it will take that date instead
of the date at the top I really want.
because it first searches for FEB and later on for AUG.
How can I change this so that the right date will be found.
Regards
Marco