need help to insert an image with a caption with the Libo java API

Michael Weghorn m.weghorn at posteo.de
Wed Feb 13 10:38:44 UTC 2019


[Taking this back to the dev mailing list]

On 12/02/2019 19.10, sos wrote:
> I supose the image and the IllustrationReference are placed in a textframe ?
> 
> 
> sub InsertIllustrationReference
>   oDoc = ThisComponent
>   oText = oDoc.getText()
>   oViewCursor = oDoc.getCurrentController().getViewCursor()
> 
>   oReference = oDoc.createInstance("com.sun.star.text.textfield.GetReference")
>   With oReference
>     .SourceName = "Illustration"
>     .ReferenceFieldPart = com.sun.star.text.ReferenceFieldPart.ONLY_SEQUENCE_NUMBER
>     .ReferenceFieldSource = com.sun.star.text.ReferenceFieldSource.SEQUENCE_FIELD
>     .SequenceNumber = 0
>   End With
> 
>   oText.insertTextContent(oViewCursor, oReference, False)
> end sub

Seems so, Miklos's reply also mentions it's just a text frame.


PS: I just realized I hadn't properly read (or taken into account) the
email subject for my reply...


More information about the LibreOffice mailing list