Recorded macros aren’t always the way to go. Tried it & saw it’s missing image name but even with that couldn’t get it to work. Put together this macro:
sub ImageForeground
rem ----------------------------------------------------------------------
dim oDrawPage as object
dim oImage as object
dim iCount as Integer
rem ----------------------------------------------------------------------
rem get access to the document
oDrawPage = ThisComponent.getSheets().getByName("YOUR-SHEET-NAME-HERE").getDrawPage()
iCount = oDrawPage.Count
rem search for proper image
for x = 0 to iCount
oImage = oDrawPage.getByIndex(x)
If oImage.Name = "IMAGE-NAME-HERE" Then
rem image found - bring to foreground
oImage.LayerID = 0
Exit Sub
End If
Next x
rem Image not found - error
MsgBox "Object not Found"
end sub
You need to enter two items where indicated - the sheet name (same as tab) and image name (from navigator). The line oImage.LayerID = 0
brings the image to the foreground. If this is set to a 1
, it would send the image to the background.