Hi ive created a macro to search through a folder containing documents of a specific format, im wanting to search through these files and change a date within the files.
the document contains a release date Like :
Release Apr 06
but it could be :
Release May 06
so i need to search through the files for something like:
Release ???????
and once it finds the release date to replace the date to a set constant of "Release Jan 06"
here is part of the code :
'Replaces all release dates with the new date
With Selection.Find
.ClearFormatting
'We allow the replacement of 7 chrs
.Text = "Release ???????"
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchFuzzy = False
.MatchWildcards = True
If .Found = True Then
With .Replacement
.ClearFormatting
.Text = m_dateReplacement
End With
blnFoundReleaseDate = .Found
.Execute Replace:=wdReplaceAll, Wrap:=wdWrapAlways
End If
.Execute Format:=False, Forward:=True
End With
for some reason when it finds a date that needs to be changed, it wont change it.
it saves the new file into a new location but just wont change the date
any pointers would be greatly appreciated.
thanks
the document contains a release date Like :
Release Apr 06
but it could be :
Release May 06
so i need to search through the files for something like:
Release ???????
and once it finds the release date to replace the date to a set constant of "Release Jan 06"
here is part of the code :
'Replaces all release dates with the new date
With Selection.Find
.ClearFormatting
'We allow the replacement of 7 chrs
.Text = "Release ???????"
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchFuzzy = False
.MatchWildcards = True
If .Found = True Then
With .Replacement
.ClearFormatting
.Text = m_dateReplacement
End With
blnFoundReleaseDate = .Found
.Execute Replace:=wdReplaceAll, Wrap:=wdWrapAlways
End If
.Execute Format:=False, Forward:=True
End With
for some reason when it finds a date that needs to be changed, it wont change it.
it saves the new file into a new location but just wont change the date
any pointers would be greatly appreciated.
thanks