Hi Andrew and all,
No problem. But now I encounter a problem in running the following code
(a part of Christian solution) which causes a crash in Writer.
oBitmaps = oDoc.createInstance( "com.sun.star.drawing.BitmapTable" )
oBitmaps.insertByName( cInternalName, cUrl )
I have filed an issue about this problem and will continue the testing
once it has been fixed.
Best Regards,
MuiFull
Andrew Douglas Pitonyak wrote:
Please report your findings. I cover this topic in my free macro
document and I can add that information into the document.
MuiFull Tam wrote:
HI Stephan,
I tried with your solution and it worked perfectly. :) Thanks for
taking time! I will try also the solution from Christian and compare
which one performs better.
Thanks again for your help!
Best Regards,
MuiFull
Stephan Wunderlich wrote:
Hi MuiFull,
I couldn't find any UNO-Interfaces that help to insert unlinked
graphics, but the dispatch-API seems to do the job, so something like
after looking some more I found some UNO-API calls that will at
least work in OOo2.0
Sub Main
oDoc = thiscomponent
xShape =
oDoc.createInstance("com.sun.star.drawing.GraphicObjectShape")
xTextContent =
oDoc.createInstance("com.sun.star.text.GraphicObject")
oDoc.getDrawPage.add(xShape)
GraphicProvider =
createUnoService("com.sun.star.graphic.GraphicProvider")
dim mediaprops(0) as new com.sun.star.beans.PropertyValue
mediaprops(0).Name="URL"
mediaprops(0).Value="file:///<YOURPATH>/<YOURFILE>"
xGraphic = GraphicProvider.queryGraphic(mediaprops())
xShape.Graphic = xGraphic
xTextContent.graphicurl = xShape.graphicurl
xText= thiscomponent.getText()
xTextCursor = xText.createTextCursor()
xText.insertTextContent(xTextCursor, xTextContent, false)
oDoc.getDrawPage.remove(xShape)
End Sub
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]