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


Dag Alain ,
vlaming ja !

i see you use only the dispatcher you write your macro,
some actions can not been recorded, what not mean there is no dispatch action for it, there is a list for all dispatch actions <http://hermione.s41.xrea.com/pukiwiki/index.php?OOoBasic%2FGeneric%2Fcommands_2.2.1>
on this "hermione" website you find nearly all code you need
do some more Googling for examples and try to use the API based Basic Code.
so google for
Openoffice basixc API insert Image
Openoffice basixc API insert textframe
etc....

Groeten Fernand
(maandag ben ik terug op kantoor en daar heb ik ook alle code voorbeelden die je nodig hebt)
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("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args2(3) as new com.sun.star.beans.PropertyValue
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,
Alain





--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


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.