ich brauche mal wieder Hilfe: Auf dem zweite Tabellenbaltt ist eine Grafik mit dem Namen "Bild". Ein Makro soll dieses auf dem ersten Tabellenblatt einfügen - Es fügt aber nicht die Grafik, sondern nur einen Platzhalter ein. Was mache ich falsch?
Mein Code:
Code: Alles auswählen
sub GrafikEinf
dim oDrawpage as object
dim oDoc as object
dim NewGrafik as object
oPage=ThisComponent.drawpages(0)
oDoc=ThisComponent
NewGrafik=odoc.createInstance("com.sun.star.drawing.GraphicObjectShape")
with NewGrafik
.Position=erzeugePunkt(100,100)
.Size=erzeugeSize(10000,10000)
end with
NewGrafik.GraphicURL=oPicture_URL
oPage.add(NewGrafik)
end sub
function oPicture_URL
dim eDrawpage as object
dim oGrafik as object
dim oPicture as object
eDrawpage=ThisComponent.drawpages(1)
for i=0 to eDrawpage.count -1
opicture = eDrawpage(i)
if opicture.Name = "Bild" then
f_Picture_URL = oPicture.GraphicURL '
end if
next
end function
Function erzeugePunkt (ByVal x as Long, ByVal y as long) as com.sun.star.awt.Point
dim oPunkt as new com.sun.star.awt.Point
oPunkt.X=x
oPunkt.Y=y
erzeugePunkt=oPunkt
End Function
Function erzeugeSize (ByVal Breite as Long, ByVal Hoehe as Long) as com.sun.star.awt.Size
Dim oSize as new com.sun.star.awt.Size
oSize.Width=Breite
oSize.Height=Hoehe
erzeugeSize=oSize
end function
Pit