G
gus
I want a macro that finds a specified text to a brunch of word documents ,
and then copy talla the paragraphs (one or more) before this text to another
word file.
I have made the macro up to the point of opening all the docs from a
specified directory.
But i can't make it to the end.
Please if anyone knows.
The macro for open all the files one by one is:
Sub Macro1()
Dim strFile As String, strPath As String
Dim intCounter As Integer
Application.ScreenUpdating = False
strPath = "c:\dir1\"
strFile = Dir(strPath & "*.doc")
Do While strFile <> ""
ff = ff + 1
'
''Workbooks.Open strPath & strFile
On Error Resume Next
Documents.Open strPath & strFile, ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
...................................
..................................
strFile = Dir()
Loop
End Sub
and then copy talla the paragraphs (one or more) before this text to another
word file.
I have made the macro up to the point of opening all the docs from a
specified directory.
But i can't make it to the end.
Please if anyone knows.
The macro for open all the files one by one is:
Sub Macro1()
Dim strFile As String, strPath As String
Dim intCounter As Integer
Application.ScreenUpdating = False
strPath = "c:\dir1\"
strFile = Dir(strPath & "*.doc")
Do While strFile <> ""
ff = ff + 1
'
''Workbooks.Open strPath & strFile
On Error Resume Next
Documents.Open strPath & strFile, ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
...................................
..................................
strFile = Dir()
Loop
End Sub