Hi, again!
I've tried using the "Split Merged Output to Separate Documents" macro but it asks "How many Section breaks are there per record?", I write how many there are, press OK and nothing happens.
I realized I should use the bellow code as i can use a delimiter to separate the Q&As, but still, I cannot save the documents with the text from inside it as name and it also changes the format style of the question, which initially was Heading1.
Could you kindly help??
Thanks!
Sub SplitNotes(delim As String, strFilename As String)
Dim Doc As Document
Dim arrNotes
Dim i As Long
Dim X As Long
Dim Response As Integer
arrNotes = Split(ActiveDocument.Range, delim)
Response = MsgBox("This will split the document into " & UBound(arrNotes) + 1 & " sections.Do you wish to proceed?", 4)
If Response = 7 Then Exit Sub
For i = LBound(arrNotes) To UBound(arrNotes)
If Trim(arrNotes(i)) <> "" Then
X = X + 1
Set Doc = Documents.Add
Doc.Range = arrNotes(i)
Doc.SaveAs ThisDocument.Path & "\" & strFilename & Format(X, "000")
Doc.Close True
End If
Next i
End Sub
Sub test()
'delimiter & filename
SplitNotes "///", "Notes "
End Sub
|