Dim m As Map = CreateMap("V_NAME": "Kohle", "V_VORNAME": "Jürgen")
    
    
    Dim doc As JavaObject = OpenDocx(File.DirApp, "input.docx")
    
      Dim paragraphs As List = doc.RunMethod("getParagraphs", Null)
       For Each p As JavaObject In paragraphs
           Dim runs As List = p.RunMethod("getRuns", Null)
           If runs.IsInitialized Then
               For Each r As JavaObject In runs
                   Dim text As String = r.RunMethod("getText", Array(0))
                   If text <> Null Then
                       For Each key As String In m.Keys
                           If text.Contains("$" & key & "$") Then
                               r.RunMethod("setText", Array(" " & m.Get(key) & " ", 0))
                           End If
                       Next
              
                   End If
               Next
           End If
       Next
       SaveDocument(doc, File.DirApp , "output.docx")