Difference between revisions of "User talk:גאַנגלערי"
From Apache OpenOffice Wiki
(You can find me at ~~~) |
(→my first macro: added section « my first macro ») |
||
Line 1: | Line 1: | ||
You can find me at ·‎[[User:גאַנגלערי|גאַנגלערי]]·[[User_talk:גאַנגלערי|T]]·[[wikipedia:m:user:Gangleri|m:]] [http://en.wikipedia.org/wiki/m:user_talk:Gangleri?action=history Th]·[[wikipedia:m:user talk:Gangleri|T]]·[[wikipedia:m:special:Emailuser/Gangleri|email me]]·‎ | You can find me at ·‎[[User:גאַנגלערי|גאַנגלערי]]·[[User_talk:גאַנגלערי|T]]·[[wikipedia:m:user:Gangleri|m:]] [http://en.wikipedia.org/wiki/m:user_talk:Gangleri?action=history Th]·[[wikipedia:m:user talk:Gangleri|T]]·[[wikipedia:m:special:Emailuser/Gangleri|email me]]·‎ | ||
__TOC__ | __TOC__ | ||
+ | == my first macro == | ||
+ | |||
+ | <pre> | ||
+ | sub begin_end | ||
+ | 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 ---------------------------------------------------------------------- | ||
+ | dispatcher.executeDispatch(document, ".uno:GoToStartOfLine", "", 0, Array()) | ||
+ | |||
+ | rem ---------------------------------------------------------------------- | ||
+ | dim args2(0) as new com.sun.star.beans.PropertyValue | ||
+ | args2(0).Name = "Text" | ||
+ | args2(0).Value = "begin" | ||
+ | |||
+ | dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args2()) | ||
+ | |||
+ | rem ---------------------------------------------------------------------- | ||
+ | dispatcher.executeDispatch(document, ".uno:GoToEndOfLine", "", 0, Array()) | ||
+ | |||
+ | rem ---------------------------------------------------------------------- | ||
+ | dim args4(0) as new com.sun.star.beans.PropertyValue | ||
+ | args4(0).Name = "Text" | ||
+ | args4(0).Value = "end" | ||
+ | |||
+ | dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args4()) | ||
+ | |||
+ | rem ---------------------------------------------------------------------- | ||
+ | dim args5(1) as new com.sun.star.beans.PropertyValue | ||
+ | args5(0).Name = "Count" | ||
+ | args5(0).Value = 1 | ||
+ | args5(1).Name = "Select" | ||
+ | args5(1).Value = false | ||
+ | |||
+ | dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args5()) | ||
+ | |||
+ | |||
+ | end sub | ||
+ | </pre> | ||
+ | |||
+ | comments:‎ | ||
+ | |||
+ | : This macro should « loop » until the « end of file » is reached. | ||
+ | : Can anybody give me a hand? | ||
+ | : Thanks for all your efforts in advance. Best regards ·‎[[User:גאַנגלערי|גאַנגלערי]]·[[User_talk:גאַנגלערי|T]]·[[wikipedia:m:user:Gangleri|m:]] [http://en.wikipedia.org/wiki/m:user_talk:Gangleri?action=history Th]·[[wikipedia:m:user talk:Gangleri|T]]·[[wikipedia:m:special:Emailuser/Gangleri|email me]]·‎ 05:05, 24 November 2007 (CET) |
Revision as of 04:05, 24 November 2007
You can find me at ·גאַנגלערי·T·m: Th·T·email me·
Contents
my first macro
sub begin_end 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 ---------------------------------------------------------------------- dispatcher.executeDispatch(document, ".uno:GoToStartOfLine", "", 0, Array()) rem ---------------------------------------------------------------------- dim args2(0) as new com.sun.star.beans.PropertyValue args2(0).Name = "Text" args2(0).Value = "begin" dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args2()) rem ---------------------------------------------------------------------- dispatcher.executeDispatch(document, ".uno:GoToEndOfLine", "", 0, Array()) rem ---------------------------------------------------------------------- dim args4(0) as new com.sun.star.beans.PropertyValue args4(0).Name = "Text" args4(0).Value = "end" dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args4()) rem ---------------------------------------------------------------------- dim args5(1) as new com.sun.star.beans.PropertyValue args5(0).Name = "Count" args5(0).Value = 1 args5(1).Name = "Select" args5(1).Value = false dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args5()) end sub
comments: