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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]