


(3) And the splitting documents will be saved to the same place with the original file. (2) You can change the documents "Notes" in the sub Test to suit your needs. Also, you can change "///" to any delimiters to meet your need.

(1) Be sure to add your delimiter as the same as "///" in the sub test to the document between each section of text you wish to separate. In the popping out Microsoft Word document, please click the Yes button to go ahead. Then click Run button or press F5 key to apply the VBA.Ĥ. Response = MsgBox("This will split the document into " & UBound(arrNotes) + 1 & " sections.Do you wish to proceed?", 4)įor I = LBound(arrNotes) To UBound(arrNotes)ĭoc.SaveAs ThisDocument.Path & "\" & strFilename & Format(X, "000")ģ. VBA: Split Word Document into Multiple Documents by Delimiter Sub SplitNotes(delim As String, strFilename As String)ĪrrNotes = Split(ActiveDocument.Range, delim) Click Insert > Module, and then paste below VBA code into the new opening Module window. Press Alt + F11 keys together to open the Microsoft Visual Basic for Application window Ģ. Instead of splitting document into multiple documents manually, this method will introduce a VBA to split a Word document by the specified delimiter in Word.
