複数の人物とその詳細を含む Word ファイルがあります。
このファイルを各人ごとに 1 つのファイルに分割する必要があります。
これはコードです。そのほとんどは、私が見つけた例からのものです。
ファイルを区切り文字 (個人用) で分割する必要があります。
各ファイルは、区切り文字のすぐ下にある ID 番号で名前を付ける必要があります。
Sub SplitNotes (delim As String)
    Dim sText As String
    Dim sValues(10) As String
    Dim doc As Document
    Dim arrNotes
    Dim strFilename As String
    Dim Test As String
    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)
             'Find "EID: "
             doc.Range.Find.Text = "EID: "
             'Select whole line
             Selection.Expand wdLine
             'Assign text to variable
             sText = Selection.Text
             'Remove spaces
             sText = Replace(sText, " ", "")
             'Split string into values
             sValues = Split(sText, ":")
            strFilename = "Testing"
            doc.SaveAs ThisDocument.Path & "\" & strFilename & Format(X, "Agent")
            doc.Close True
        End If
    Next I
End Sub
Sub Test()
    'delimiter
    SplitNotes "Name:"
End Sub 
Word 文書は次のように設定されます。
    個人的
    名前: ジョン・スミス
    EID: Alph4num3r1c (私が知っているように設定された長さではありません)
    詳細はこちらから
私の問題は、ID 番号を取得し、それを関数として保存で使用することです。
分割機能がどのように機能するかを完全に理解していません。