LibreOfficeDev 7.5 laguntza
Instantiates a UNO service with the ProcessServiceManager, including supplemental optional arguments.
CreateUnoServiceWithArguments(ServiceName As String, Arguments() As Variant) As Object
UNO services that can be used with CreateUnoServiceWithArguments function are identifiable with method names that follow a createInstanceWith.. or createWith.. naming pattern.
ServiceName: Sortuko den UNO zerbitzuaren izena.
Arguments: One to many arguments that specify the instance of the service. Arguments are stored as a one dimensional array, according to their positions in the constructor method definition.
An instance of the given UNO service name, otherwise Null value.
For a list of available services, visit the com::sun::star Module reference page.
The com.sun.star.ui.dialogs.FilePicker example below displays a Save As dialog with two extra controls: a listbox and a checkbox.
Sub FileSaveAsDialog()
td = com.sun.star.ui.dialogs.TemplateDescription
options = td.FILESAVE_AUTOEXTENSION_TEMPLATE
dlg = createUnoServiceWithArguments( _
"com.sun.star.ui.dialogs.FilePicker", _
Array(options))
End Sub ' FileSaveAsDialog
UNO zerbitzuek lineako dokumentazio zabala dute api.libreoffice.org webgunean. Bisitatu FilePicker zerbitzua erreferentziako orria goiko adibidean erabili den zerbitzuak eskaintzen dituen metodoei buruz gehiago jakiteko.
Hurrengo kodeak com.sun.star.security.DocumentDigitalSignatures zerbitzua darabil uneko dokumentua sinatzeko:
Sub SignCurrentDocDialog
Dim pv(0) as new com.sun.star.beans.PropertyValue
pv(0).Name = "StorageFormat"
pv(0).Value = "ZipFormat"
mode = com.sun.star.embed.ElementModes
sf = CreateUnoService("com.sun.star.embed.StorageFactory")
storage = sf.createInstanceWithArguments(Array(ThisComponent.URL, mode.WRITE, pv))
dds = CreateUnoServiceWithArguments( _
"com.sun.star.security.DocumentDigitalSignatures", _
Array("1.2", True))
dds.signDocumentContent(storage, Null)
End Sub ' SignCurrentDocDialog
CreateWithVersion and createWithVersionAndValidSignature constructor methods in com.sun.star.security.DocumentDigitalSignatures UNO service indicate two different ways of instantiating this service with CreateUnoServiceWithArguments function.