Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index

Hello all,

I'm writing a macro to create a document entirely based on database-contents. I have an image (page-sized) that should come on the first page, and then I should put the title on top of it and the jump to the next page. The part that follows (TOC + further contents of the document) is about finished and working but I have trouble with my title-page.

I tried to record the inserting of the image, then add text on top of it using the drawing toolbar, then set the properties of that text to centered (horizontal and vertical), size it to the text and then jump to the next page.

This resulted in this:

sub afbeelding_en_titel
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("")

rem ----------------------------------------------------------------------
dim args2(3) as new
args2(0).Name = "FileName"
args2(0).Value = "file:///home/alain/Data/Indiegroup/Cover%20Offerte%20Site%20Builder.jpg"
args2(1).Name = "FilterName"
args2(1).Value = "<Alle indelingen>"
args2(2).Name = "AsLink"
args2(2).Value = false
args2(3).Name = "Style"
args2(3).Value = "Afbeeldingen"

dispatcher.executeDispatch(document, ".uno:InsertGraphic", "", 0, args2())

rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:InsertDraw", "", 0, Array())

rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:TransformDialog", "", 0, Array())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:TextAttributes", "", 0, Array())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:InsertLinebreak", "", 0, Array())

As you can see the recording didn't work after the inserting of the image and I find no documentation that accurately helps me figure it out the InsertDraw, TransformDialog and TextAttributes myself.

Could anybody help me on this one?
Any suggestion is welcome...

Thanks in advance,

To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.