How to call from OO Basic the print menu, however with preloaded values?

Suppose have a example:

Sub TPrint(Optional PrintedDoc as Object)
' For testing on already open document:
If IsMissing(PrintedDoc) Then PrintedDoc=ThisComponent
DocFrame=PrintedDoc.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args0(0) as new com.sun.star.beans.PropertyValue 
dim args1(0) as new com.sun.star.beans.PropertyValue 
dim args2(0) as new com.sun.star.beans.PropertyValue 
' When we do:
dispatcher.executeDispatch(DocFrame, ".uno:Print", "", 0, args0()) 
' then the printing menu with preview opens for manual intervention, but if the argument list is properly initialized:
args1(0).Name = "RangeText"
args1(0).Value =  "2,1"
dispatcher.executeDispatch(DocFrame, ".uno:Print", "", 0, args1()) 
' ...then the printout is made automatically, without the possibility of manual intervention.
' Also the method .print is "direct":
args2(0).Name = "Pages"
args2(0).Value =  "2,1"
PrintedDoc.print args2()
End Sub

What do i need: open the printing panel (the same where opens after selecting “print” from LibreOffice menu) just like when calling the dispatcher with uninitialized argument list, BUT with arguments (first of all the page list) preloaded to the manual panel. I want the great existing (multipage available) print (graphics) preview, but with the initial values are loaded. How to do it?

uno:Print command arguments are documented in the wiki
The Basic IDE example code details how to send arguments.

@LibreOfficiant - I hoped that the example invocation indicated that I know what you point perfectly well.
Have you read my question? It is not “how to load paramets”.
It concerns the “how to get a preview with the given values” problem!
WITHOUT parameters (when the table points to nothing) it works automatically.
But WITH parameters (even if only one) the same call automatically generates a printout.
WITHOUT preview, unfortunatelly.
And the preview is critical for me, not the values od printing itself.
On the parameter list I don’t see anything like “open preview”, “run directly” etc.

The .uno:print command does not have a parameter that allows you to put page numbers. There are two ways:

  • ask the developers to add this parameter
  • use service AccessibleContext to put page numbers in the print dialog (but this way is very, very long)

Dear reader(s) - I am look how to call the printer preview panel.
Without the needs, I will prefer direct call to .setPrinter and .Print method, without using dispatcher at all.
But mimic the printer preview (preview of the sheets, not the pages) may be hard and time consuming, or even impossible in OO Basic at all.
Is it possible to force the “.uno:Print” to do preview when induced with parameters?
Also, please don’t suggest something like “.uno:PrintPreview”, as I do not need the page preview, but the sheet preview. Especially when printing several pages on one sheet, for clarity.
Can someone give me an idea?
Or maybe there is method to call it directly (from macro code), and from what object? (chcecking thru xray does nothing, as the .print method does’nt return value xray will not expand potential list[s], and - if exists - it may be a separate element, event only binded to (but not part of) ThisComponent.
By “binding” I mean a mechanism similar to any cursor references (thus to presentation of document on the screen, not the document itself), and I have no idea where to look for something like printPreview method (if exists).

@sokol92 - probably the developer listened to the request before it was given :slight_smile:
Really - I did not check if the value of RangeText is supported as list, just seeing it, I used it as a list and… it works. Now I checked that it works for any list (also a list of disjoint page ranges).
Without any basis I am suspect, that the value interpreter is the same, as the one for the method .print in document object.
If you say, that the “preview via dispatcher” resolution may be hard and time consuming, will (at least temporary) force a “preview” thru virtual PDF printer, and put it aside for later (possibly newer).
Thanks.