JohnSUN-Pensioner wrote:Not the answer, just a little explanation: when OOKapitan writes "PCM", he meant the right click of the mouse
If I know more or less excel macros, then I do not understand anything in OO macros.
RoryOF wrote:It should be simple to write a Windows batch file to read a directory, t hen feed each file name into the OO command line until there are no more files left.
soffice.exe -p D:\Data\PrintDocs\*.od?
soffice.exe -pt PrinterName D:\Data\PrintDocs\*.od?
Villeroy wrote:Shell command to send all ODF documents in D:\Data\PrintDocs\ to the default printer:
- Code: Select all Expand viewCollapse view
soffice.exe -p D:\Data\PrintDocs\*.od?
Same with explicit printer name:
- Code: Select all Expand viewCollapse view
soffice.exe -pt PrinterName D:\Data\PrintDocs\*.od?
soffice.exe -pt PrinterName D:\Data\PrintDocs\*.od?
soffice.exe -pt PrinterName D:\Data\PrintDocs\*.od?
RoryOF wrote:You are more likely to crash something using a macro.
Make a small test directory with two or three trivial files and try using that.
robleyd wrote:You run this from a command prompt
1) it prints out from the directory c:\printpath, but I would like the macro to let me select a folder or to print out from the same folder the macro is in (to select the folder would be better);
...
Dim sPath
sPath = getFolder("Please select a folder") & GetPathSeparator()
...
Function getFolder(sTitle AS String, optional sInitDir) AS String
oPicker = CreateUnoService("com.sun.star.ui.dialogs.FolderPicker")
oPicker.setTitle(sTitle)
if not ismissing(sInitDir) then oPicker.setDisplayDirectory(sInitDir)
if oPicker.execute() then getFolder = oPicker.getDirectory()
End Function
I tried. The macro allowes me to select the folder, but prints nothing. I forgot to say that the files must be opened visibly or they won't be printed.
Zizi64 wrote:I tried. The macro allowes me to select the folder, but prints nothing. I forgot to say that the files must be opened visibly or they won't be printed.
Really, the usage of the filepicker is only the first part of the full macro what you needed. Then you must open (LoadFromURL...) the documents one by one (silently or visible) based on the picked path and the DIR strings as filenames, and then you will able to use the Print command of the API.
Please help me to write full macro.
In excel to write macro I in minimum just need to understand english. For macro in OpenOffice it doesn't work.
Users browsing this forum: No registered users and 7 guests