Ask Your Question
0

How to specify the position of pasted graphics in basic

asked 2019-12-13 12:07:35 +0100

Pansmanser gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2019-12-13 19:01:32 +0100

updated 2019-12-14 22:33:41 +0100

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

Tested in:

Version: 6.2.8.2
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3;

EDIT: Add image for property HoriOrient

image description

edit flag offensive delete link more

Comments

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 6.3.3.2 and Ubuntu 18.04. I normally specify that if behaviour seems anomalous, but this feels like a standard behaviour.

Pansmanser gravatar imagePansmanser ( 2019-12-13 21:29:21 +0100 )edit

See the image for values for property HoriOrient, is the same for VertOrient

Best regards

mauricio gravatar imagemauricio ( 2019-12-14 22:34:43 +0100 )edit

Thanks, Mauricio. Should have realised that's what it referred to.

Pansmanser gravatar imagePansmanser ( 2019-12-15 13:16:16 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-12-13 12:07:35 +0100

Seen: 102 times

Last updated: Dec 14 '19