How do I make a single document from another 500 by appending
Hi guys,
Thanks a lot to both of you for your support. It went very well. It was
exactly what I needed.
Thanks again.
Best regards,
Costi ANDRITOIU
"Helmut Weber" wrote:
Hi Costi,
in principle like that:
Sub Macro3()
Dim strSourcePath As String
Dim strDocumToAdd As String
strSourcePath = "c:\test\word\"
strDocumToAdd = Dir(strSourcePath & "*.doc", vbNormal)
While strDocumToAdd ""
ActiveDocument.Bookmarks("\endofdoc").Select
Selection.InsertFile _
FileName:=strSourcePath & strDocumToAdd
ActiveDocument.Save
ActiveDocument.UndoClear
strDocumToAdd = Dir
Wend
End Sub
Make sure, that the actual doc is in a folder
different from the folder, where all the small docs are.
I've tried to keep it simple,
there are many other maybe faster ways.
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
|