|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub a___DocMerge()
- Dim d As Document, p$, s$
- Set d = Documents.Add
- p = SelectFolder
- s = Dir(p & "*.doc*")
- GoSub doc
- Do While s > ""
- s = Dir
- GoSub doc
- Loop
- doc:
- If s = "" Then MsgBox "All doc merged!", 0 + 48: Exit Sub
- Selection.InsertFile FileName:=p & s
- ' Selection.TypeParagraph
- Selection.InsertBreak Type:=0
- Return
- End Sub
- Function SelectFolder() As String
- With Application.FileDialog(msoFileDialogFolderPicker)
- If .Show Then SelectFolder = .SelectedItems(1) & "" Else End
- End With
- If MsgBox("Are you sure you want to select the folder " & vbCr & SelectFolder & " ?", 4 + 16) = vbNo Then End
- End Function
复制代码 |
评分
-
1
查看全部评分
-
|