I have the following code to insert an embedded image on a WriterFile. The
code is VB.NET
Dim MyDispatcher As XDispatchHelper = MyMServiceFactory.createInstance("
com.sun.star.frame.DispatchHelper")
Dim MyProp(3) As unoidl.com.sun.star.beans.PropertyValue
MyProp(0) = MakePropertyValue("FileName", strImgFileName)
MyProp(1) = MakePropertyValue("AsLink", False)
MyProp(2) = MakePropertyValue("Style", "Image")
Dim an As unoidl.com.sun.star.frame.DispatchResultEvent = DirectCast(
MyDispatcher.executeDispatch(aDocument.getCurrentController.getFrame,
".uno:InsertGraphic", "", 0, MyProp).Value,
unoidl.com.sun.star.frame.DispatchResultEvent)
Dim MyController As XController = aDocument.getCurrentController
Dim MySelecionSupplier As XSelectionSupplier = DirectCast(MyController,
XSelectionSupplier)
Dim selection As uno.Any = MySelecionSupplier.getSelection
Dim sel As unoidl.com.sun.star.drawing.XShape = selection.Value
Dim strShapeType As String = sel.getShapeType
' Dim pos As unoidl.com.sun.star.awt.Point = sel.getPosition
sel.setSize(New unoidl.com.sun.star.awt.Size(SizeWidth, SizeHeight))
But i still have a problem with it... How can i set the position to a
BookMark position???
--
__________________________________________________________
"O único lugar onde o sucesso vem antes que o trabalho é no dicionário"