Hi
I would like to know how to insert an image in docx document.
At this time, replace text with this procedure:
I would like to know how to insert an image in docx document.
At this time, replace text with this procedure:
B4X:
Dim m As Map = CreateMap("jesus": "lizon")
Dim doc As JavaObject = OpenDocx("C:\test","document.docx")
Dim AllParagrpahs As List
AllParagrpahs.Initialize
Dim headers As List = doc.RunMethod("getHeaderList", Null)
For Each header As JavaObject In headers
AllParagrpahs.AddAll(header.RunMethod("getParagraphs", Null))
Next
AllParagrpahs.AddAll(doc.RunMethod("getParagraphs", Null))
For Each p As JavaObject In AllParagrpahs
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, "C:\test","TEST2.docx")