incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peng Chen <chenpeng2...@gmail.com>
Subject Re: question about aoo record macro?
Date Tue, 05 Jun 2012 00:47:09 GMT
Hi Jian Li,
      About question 2, you can get the image object like this:
        image = ThisComponent.getGraphicObjects().getbyIndex(0)

2012/6/4 jianlizhao <jianlizhao6@hotmail.com>

> hello my friend:
>
> I have two question as below:
> 1)  in aoo , record macro of Insert picture,Why insert picture code written
> two times?
>  Example code  as below:
>
> sub Main
> 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 args1(3) as new com.sun.star.beans.PropertyValue
> args1(0).Name = "FileName"
> args1(0).Value = "file:///C:/2.png"
> args1(1).Name = "FilterName"
> args1(1).Value = "<All formats>"
> args1(2).Name = "AsLink"
> args1(2).Value = true
> args1(3).Name = "Style"
> args1(3).Value = "Graphics"
>
> dispatcher.executeDispatch(document, ".uno:InsertGraphic", "", 0, args1())
>
> rem ----------------------------------------------------------------------
> dim args2(3) as new com.sun.star.beans.PropertyValue
> args2(0).Name = "FileName"
> args2(0).Value = "file:///C:/2.png"
> args2(1).Name = "FilterName"
> args2(1).Value = "<All formats>"
> args2(2).Name = "AsLink"
> args2(2).Value = true
> args2(3).Name = "Style"
> args2(3).Value = "Graphics"
>
> dispatcher.executeDispatch(document, ".uno:InsertGraphic", "", 0, args2())
>
> end sub
>
> 2)  after insert picture, how get the image object.
>    The image will be  processing of rotation  eg.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message