Hvordan importere man tekst-filer en-block i word?
-> RVM: hvordan bruger jeg nedenstående kode til at importere en række tekst-filer i et enkelt word doc.Tusinde tak!
- seby
Sub Løkke()
StartDokument = ActiveDocument.Name
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\rima2-pc1\Skrivebord\Kodeeksempler"
.FileName = "*.doc"
.SearchSubFolders = True
.Execute
.FileType = msoFileTypeWordDocuments
For i = 1 To .FoundFiles.Count
Documents.Open FileName:=.FoundFiles(i)
Selection.WholeStory
Selection.Copy
ActiveDocument.Close False
Application.Documents(StartDokument).Activate
Selection.Paste
Selection.EndKey Unit:=wdLine
Selection.TypeParagraph
Next
End With
End Sub