"Terry" <[EMAIL PROTECTED]> napísal v správe 
news:[EMAIL PROTECTED]
> Peter Ruman wrote:
>> Hello,
>>
>> I'm creating macro in Calc that should (besides other things) add inner 
>> and outer borders to a group of cells. As I am a beginner in OOo, I'm 
>> using the macro recorder to record the actions and then modifying the 
>> actions to suit my needs. So I recorded a macro of following actions:
>> 1. select group of cells,
>> 2. add inner borders using menu.
>>
>> The recorded macro follows:
>>
>> sub borders
>> 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(1) as new com.sun.star.beans.PropertyValue
>> args1(0).Name = "By"
>> args1(0).Value = 1
>> args1(1).Name = "Sel"
>> args1(1).Value = true
>>
>> dispatcher.executeDispatch(document, ".uno:GoDownToEndOfData", "", 0, 
>> args1())
>>
>> rem ----------------------------------------------------------------------
>> dim args2(1) as new com.sun.star.beans.PropertyValue
>> args2(0).Name = "By"
>> args2(0).Value = 1
>> args2(1).Name = "Sel"
>> args2(1).Value = true
>>
>> dispatcher.executeDispatch(document, ".uno:GoRightToEndOfData", "", 0, 
>> args2())
>>
>> rem ----------------------------------------------------------------------
>> dim args3(4) as new com.sun.star.beans.PropertyValue
>> args3(0).Name = "BorderInner.Horizontal"
>> args3(0).Value = Array(0,0,35,0)
>> args3(1).Name = "BorderInner.Vertical"
>> args3(1).Value = Array(0,0,35,0)
>> args3(2).Name = "BorderInner.Flags"
>> args3(2).Value = 3
>> args3(3).Name = "BorderInner.ValidFlags"
>> args3(3).Value = 127
>> args3(4).Name = "BorderInner.DefaultDistance"
>> args3(4).Value = 0
>>
>> dispatcher.executeDispatch(document, ".uno:BorderInner", "", 0, args3())
>>
>> end sub
>>
>> The problem is that when I run the code, it doesn't work. It acts as it's 
>> working - selects proper group of cells, but doesn't add the borders. But 
>> when I do the same (recording a macro and playing it back) with outer 
>> borders, it works fine. Can anyone please tell me, what is wrong and how 
>> do I work this out?
>>
>> Thanks in advance :)
>>
>> Peter Ruman
>
> Hi.  I've run the recorded code.  It selected a group of cells and failed 
> to add any border.
>
> You may have used the dialogue of Format >Cells incorrectly.  What exactly 
> did you do and what did you hope to achieve?
>
> Why do you need separate macros for the borders?
>
>
> -- 
>
> If you're seeking, check out http://www.rci.org.au



Hi. I don't think I have used it incorrectly. I just selected a group of 
cells, clicked Format->Cells, then clicked the Borders tab, chose width of 
the border, clicked the inner borders and then OK. Exactly like I do it 
everytime, whether I'm recording a macro or not. You see, the problem is not 
that I'm doing it wrong. The problem is I record the macro, the effects of 
my actions are normally applied to the spreadsheet, but when I try to 
reproduce the effects by running the recorded macro, somehow I don't get 
them. The macro does exactly what you wrote - selects a group but doesn't 
add any border.

I don't need separate macros, just posted it as a separate one. It's part of 
a larger macro code, but it would be of no use to post it here completely.

Well, try it for yourself (record the same macro, play it back and see if 
you get the results) and if you succeed, please post the code. I'd be very 
grateful.

P.S. - I also found out other thing. When I try to execute several 
consecutive copy&paste operations in macro (different source cells), only 
the first copy&paste operation succeeds, the others paste the values of the 
first copy operation... But I worked that one out somehow... OOo version is 
2.0.2. 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to