简单做了一个,没有添加错误处理代码: Sub SaveDoc() Dim P_Doc As Document, P_Path, str_Path As String, myRange As Range With Application.FileDialog(msoFileDialogFilePicker) .Title = "请选择被另存的Word文件" .AllowMultiSelect = True .Filters.Clear .Filters.Add "Word 文档", "*.doc" If .Show = -1 Then str_Path = CurDir & "\" For Each P_Path In .SelectedItems Set P_Doc = Documents.Open(FileName:=P_Path) Set myRange = P_Doc.Paragraphs(1).Range myRange.MoveEnd wdCharacter, -1 P_Doc.SaveAs str_Path & myRange.Text P_Doc.Close Next End If End With End Sub
|