I added a shape object to the existing contents of an Excel worksheet using Aspose Cells for Java like so:
Shape shape = worksheet.getShapes().addTextEffect(...);
Now, I'd like to send the shape behind the text that already existed in the worksheet. I looked up there is the setZOrderPosition
method on the Shape
object.
However, it accepts an integer value, and I can't seem to find an enum or a magic number or a sentinel that indicates Send to Back like we had the msoSendToBack
constant in the VSTO/VBA object models.
Besides, their documentation offers no explanation of the values for this method: https://apireference.aspose.com/net/cells/aspose.cells.drawing/shape/properties/zorderposition
So, like all other drawing API, I presume that the Z Order value is relative to the Z-Order of other content on the worksheet.
So, I tried specifying -1 to provide the lowest possible value.
shape.setZOrderPosition(-1);
That threw an IndexOutOfBoundsException
or some such, from which, I infer that the valid values for Z-Order are zero-based.
I provided the value 0, hoping it would be the lowest and would do the job, but appears not.
shape.setZOrderPosition(0);
The shape still overlays existing text.
How do I set the Z-Order index for the shape object properly so it goes behind the text?