Google Groups unterstützt keine neuen Usenet-Beiträge oder ‑Abos mehr. Bisherige Inhalte sind weiterhin sichtbar.

Combining Word Documents

17 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Peter

ungelesen,
22.05.2002, 17:42:5822.05.02
an
I have a directory with several dozen Word '97 files. Is
there any way to combine these files into a single file
without having to open each one individually through the
File-->Open command or Master Document?

Thanks

Lutz Gentkow

ungelesen,
23.05.2002, 03:31:0623.05.02
an
Hi Peter,

this should be possible! :-) First, see the article "Insert into a
document the names of all files in a selected folder" at
http://www.mvps.org/word/FAQs/MacrosVBA/InsertFileNamesContent.htm .

After running the macro delete the last empty line and use this macro to
convert the file names into field names:

Sub DocNames2Fields()

Dim NoOfParagraphs As Integer, i As Integer

Application.ScreenUpdating = False

Selection.HomeKey Unit:=wdStory

NoOfParagraphs = ActiveDocument.Paragraphs.Count

Do
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="IncludeText "
Selection.MoveDown Unit:=wdLine
i = i + 1
Loop Until i = NoOfParagraphs

ActiveWindow.View.ShowFieldCodes = False
Selection.WholeStory
Selection.Fields.Update
Selection.HomeKey Unit:=wdStory

End Sub

Now select the complete document (Ctrl + A) and unlink the fields with
Ctrl + Shift + F9.

Greetings from Germany

Lutz

0 neue Nachrichten