I suggest the following.  It may not be the prettiest, but it's very
simple.

Create new doc...
    Documents.Add DocumentType:=wdNewBlankDocument
    ActiveDocument.SaveAs FileName:="Combined.doc", FileFormat:= _
        wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
        True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
        False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
        SaveAsAOCELetter:=False

For each old doc (generate list of filenames however you want)
    Documents.Open FileName:="""Filename #1.doc""" _
        , ConfirmConversions:=False, ReadOnly:=False,
AddToRecentFiles:=False, _
        PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
        WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
        wdOpenFormatAuto
    Selection.WholeStory
    Selection.Copy
    Windows("Combined.doc").Activate
    Selection.Paste
    ' Insert page break between doc pages to prevent last page/first
page combination if desired
    Selection.InsertBreak Type:=wdPageBreak
    Windows("Filename #1.doc").Close

When done, save the combined file
    ActiveDocument.SaveAs FileName:="Combined.doc", FileFormat:= _
        wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
        True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
        False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
        SaveAsAOCELetter:=False



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Michael S
Sent: Tuesday, October 03, 2006 8:33 AM
To: python-win32@python.org
Subject: [python-win32] MS Word


Good day all.

Does anyone have experience in appending multiple word
file into one big file? I have a directory full of
word files and I want to make one file out of all of
them.
I tried to google it, in order at least to see it how
it's done in VBA, but haven't found any good examples.

Michael
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to