Apache OpenOffice (AOO) Bugzilla – Issue 28601
Print Text Selection: doesn't work in macro or via api
Last modified: 2017-05-20 11:22:05 UTC
StarBasic 7.0; Windows 2000; Pentium4. StarBasic and COM (via C++). Standard object API does not allow currently selected text to be printed. Hence, I have tried to use dispatcher. The "Selected" property does not work when using the dispatcher to print the current selected text (via StarBasic or COM). To reproduce: 1.) Load text file, select some text. 2.) Start recording macro 3.) Select print. Set print options as required, but set "Print Selected Text" radio button. 4.) Perform the print. Stop recording macro. Printed text should be as required - ie. just the selected text. 5.) Rerun Macro. This then prints the entire document. The same is seen when accessing the dispatcher through COM (from C++ in my case), as well as StarBasic macro. Changing other properties (eg. number of copies) demonstrates that my properties are being passed correctly.
MRU->JSK: Macro recording...
jsk->ab: is this something for you or rather mba?
Rather MBA... :-)
.
Please first try to confirm the issue, thanks.
Must wait till a later time. No ressources left at this point.
jsk->sw: Can you verify this for the API? Thanks!
As winwaed already mentioned the only way to print the current selection is via dispatch API. The macro-recorder produces the following macro: 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(2) as new com.sun.star.beans.PropertyValue args1(0).Name = "Copies" args1(0).Value = 1 args1(1).Name = "Selection" args1(1).Value = true args1(2).Name = "Collate" args1(2).Value = false dispatcher.executeDispatch(document, ".uno:Print", "", 0, args1()) end sub Unfortunately the whole text is printed when using this macro and not as intended only the selected text.
Reset assigne to the default "issues@openoffice.apache.org".