可以: 用inputbox 获得输入文件夹路径是一个简单办法。 Sub TEST() On Error Resume Next Dim mySec As Section Dim myPath, myName As String myPath = InputBox(prompt:="请填入欲保存文件夹路径" & Chr(13) & "如: C:\新建文件夹", Title:="填入路径") & "\" Selection.HomeKey wdStory With Selection.Find .ClearFormatting .ParagraphFormat.Alignment = wdAlignParagraphCenter .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = True .MatchWildcards = False End With Do While Selection.Find.Execute = True Selection.InsertBreak Type:=wdSectionBreakNextPage Selection.MoveDown wdLine, 3 Loop For Each mySec In ActiveDocument.Sections mySec.Range.Select Selection.Copy Documents.Add Selection.Paste myName = Mid(ActiveDocument.Paragraphs(1).Range.Text, 1, Len(ActiveDocument.Paragraphs(1).Range.Text) - 1) ActiveDocument.SaveAs myPath & myName & ".doc" ActiveDocument.Close False Next End Sub 注意文件夹路径可以通过文件夹地址栏复制获得,填写时结尾不要带 “\”。 |