I try to change position of an image in a document. I have error message "position can't be changed with this method"
I have try oGraphics(0).SetPosition Opos, oGraphics(0).Position = oPos. I have try with oImg instead of oGraphics(0) etc... Same error
Size works fine. Just position don't work.
What's wrong ?
Thanks
Code: Select all
Dim oGraphics as Object, ImageName as string, oPos as object
oGraphics = Doc.getGraphicObjects()
Dim oImg as Object
For Each oImg in oGraphics
ImageName = oImg.name
if ImageName="Image1" then
oImg.Width=2000
oImg.Height=2000
oPos = New com.sun.star.awt.Point
oPos.X = 10
oPos.Y = 10
oImg.setPosition(oPos)
exit for
end if
Next