https://bugs.documentfoundation.org/show_bug.cgi?id=119519
--- Comment #12 from Kai Struck <struck...@gmx.net> ---
Ah, ok , forget my previous answer, I misread your comment 10.
You are right! It should work for all versions (LO and OO) with this code:
Sub InsertGraphicObject
Dim oDoc
Dim sURL
Dim oCursor
Dim oGraph
Dim oText
sURL= ConvertToUrl("http://pmg.pmgroup.be/enews/deroulard/exploit1.jpg")
oDoc = ThisComponent
oText = oDoc.getText()
oCursor = oText.createTextCursor()
oCursor.gotoStart(False)
oGraph = oDoc.createInstance("com.sun.star.text.GraphicObject")
oGraph.Graphic = getgraphfromurlaslink(sURL)
With oGraph
.GraphicURL = sURL
.Width = 6000
.Height = 8000
End With
oText.insertTextContent(oCursor, oGraph, False)
End Sub
function getGraphFromUrlAsLink(sFileUrl as String ) as Object
oProvider = createUnoService("com.sun.star.graphic.GraphicProvider")
Dim oPropsIN(1)as new com.sun.star.beans.PropertyValue
oPropsIN(0).Name = "URL"
oPropsIN(0).Value = converttoURL(sFileUrl)
oPropsIN(1).Name = "LoadAsLink"
oPropsIN(1).Value = TRUE
getGraphFromUrlAsLink = oProvider.queryGraphic(oPropsIN())
end function
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs