On Sat Nov 20 2010 14:43:09 GMT-0800 (PST) John Connelly wrote:
My "Standard" folder was actually under "My Macros", not under
"OpenOffice.org Macros". I'll attach a pic of this, just so you can see
if mine is different that it is supposed to be. Anyway, the macro is
named ExampleSpreadsheetMacro. When I right click on it, it does not
give me an option to "copy" it as you suggested. How do I attach a
macro (by itself) to an email? Sorry, I'm probably a lot less capable
than your group.
To paste a copy get to the screen you took the shot of. Highlight the
macro like in the shot. Click the Edit button. There you will see
the text that makes up the script. Highlight the text, just like you
would in Writer, click on the Edit Menu then Copy. Then paste that into
the message like this:
----------Start of script
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(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$A$1:$F$20"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(7) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ByRows"
args2(0).Value = true
args2(1).Name = "HasHeader"
args2(1).Value = true
args2(2).Name = "CaseSensitive"
args2(2).Value = false
args2(3).Name = "NaturalSort"
args2(3).Value = false
args2(4).Name = "IncludeAttribs"
args2(4).Value = true
args2(5).Name = "UserDefIndex"
args2(5).Value = 0
args2(6).Name = "Col1"
args2(6).Value = 1
args2(7).Name = "Ascending1"
args2(7).Value = true
dispatcher.executeDispatch(document, ".uno:DataSort", "", 0, args2())
end sub
----- End of script
This I did by recording the macro as you suggested. The only thing is I
do not now how to attach it the button. But running this does as you
ask. I see no problem with the cells not changing.
Andy
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]