G
GTG
Hi,
with the help of another post I am trying to combine two macros into
one to execute the macro on a folder of .doc files.
Here is my code that has a bug:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 22/09/2005 by Warringah Council for folder macro on
Position Descriptions
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\gilleg\Desktop\testPDF\"
.SearchSubFolders = True
.FileName = "*.doc"
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
With Selection.Find
.Text = _
"<http://intra.warringah.nsw.gov.au/pdf/oh&s/GM
Ohsrprocedures201 OHSR Respon.pdf>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = _
"http://intra.warringah.nsw.gov.au/pdf/oh&s/GM
Ohsrprocedures201 OHSR Respon.pdf"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Paste
Next i
End If
End With
End Sub
Thanks.
with the help of another post I am trying to combine two macros into
one to execute the macro on a folder of .doc files.
Here is my code that has a bug:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 22/09/2005 by Warringah Council for folder macro on
Position Descriptions
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\gilleg\Desktop\testPDF\"
.SearchSubFolders = True
.FileName = "*.doc"
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
With Selection.Find
.Text = _
"<http://intra.warringah.nsw.gov.au/pdf/oh&s/GM
Ohsrprocedures201 OHSR Respon.pdf>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = _
"http://intra.warringah.nsw.gov.au/pdf/oh&s/GM
Ohsrprocedures201 OHSR Respon.pdf"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Paste
Next i
End If
End With
End Sub
Thanks.