I have a macro which inserts an image from the clipboard in a writer document. I can adjust the size of the image (oGraph.size or oGraph.height and .width), but not the position. mri indicates that oGraph.position exists but gives its value as -Error-. How can I move the image?
Please, always say your operate system and LibreOffice version, and show your code.
You can set position images by paragraph or character for relative position, in this case, first position your cursor then paste image, but, if you want set absolute position in page, used next properties:
img.AnchorType = 2 img.HoriOrient = 0 img.HoriOrientPosition = 3000 img.VertOrient = 0 img.VertOrientPosition = 3000
I assumed that the current selected object is your image
Version: 22.214.171.124 CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3;
EDIT: Add image for property HoriOrient
Thanks, mauricio! Exactly what I wanted, and also works with other anchor types… Can you tell me what the HoriOrient and VertOrient signify?
I’m on 126.96.36.199 and Ubuntu 18.04. I normally specify that if behaviour seems anomalous, but this feels like a standard behaviour.
See the image for values for property HoriOrient, is the same for VertOrient
Thanks, Mauricio. Should have realised that’s what it referred to.