Hallo,
der Druck einer Datei über das mit der Dateiendung verknüpfte Programm funktioniert mit CRTL+F9 gut. Markiere ich mehrere Dateien, wird bei dieser Tastenkombination immer nur die letzte markierte Datei gedruckt.
Gibt es einen Weg, über eine Tastenkombination alle markierten Dateien zu drucken? Danke.
Mehrere markierte Dateien über Tastenkombination drucken?
Moderators: Hacker, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50561
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Leider nicht bei allen - wenn bei Umsch+F10 der Eintrag "Drucken" erscheint, dann können Sie diesen benutzen.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
VBScript: _ForEachSelFileDo_PRINT.vbs
Über ein Skript geht alles....
- Mit dem TC-Parameter "%L" eine Liste der selektierten Dateien erstellen lassen
- Ein Skript arbeitet diese Liste Zeile für Zeile ab, und entscheidet anhand der Erweiterung (doc,xlsx,pdf,...) über die Aktion
- Als Aktion wird für das jeweilige Dokument die Print-Funktion aufgerufen.
Dieses Skript kann man als UserCmd eintragen,
[em_PrintAll]
cmd=myScript.vbs
param="%L"
und dem UserCmd eine Tastenkombination zuweisen.
Shift+Control+F9=em_PrintAll
Problem: das Skript muss noch geschrieben werden (bzw. gefunden. Eigentlich wurde doch bereits alles Mögliche bereits im Forum behandelt, oder?
)
- - - EDIT
DUMMY SKRIPT
_ForEachSelFileDo_PRINT.vbs
- - -
Hab' noch das hier gefunden:
- Mit dem TC-Parameter "%L" eine Liste der selektierten Dateien erstellen lassen
- Ein Skript arbeitet diese Liste Zeile für Zeile ab, und entscheidet anhand der Erweiterung (doc,xlsx,pdf,...) über die Aktion
- Als Aktion wird für das jeweilige Dokument die Print-Funktion aufgerufen.
Dieses Skript kann man als UserCmd eintragen,
[em_PrintAll]
cmd=myScript.vbs
param="%L"
und dem UserCmd eine Tastenkombination zuweisen.
Shift+Control+F9=em_PrintAll
Problem: das Skript muss noch geschrieben werden (bzw. gefunden. Eigentlich wurde doch bereits alles Mögliche bereits im Forum behandelt, oder?

- - - EDIT
DUMMY SKRIPT
_ForEachSelFileDo_PRINT.vbs
Code: Select all
'Total Commander VBScript
' -----------------------------------
'TC Button:
' cmd= "D:\rive\path\to\this.vbs"
' param= "%L"
' -----------------------------------
'On Error Resume Next
MsgBox "Script is not ready yet"
WScript.Quit
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WSO = Wscript.CreateObject("WScript.Shell")
Const FORREADING = 1
sTCtempList = Wscript.arguments.Item(0) ' The TC temp file due to the "%L" parameter
If FSO.FileExists(sTCtempList) Then
Set oTextStream = FSO.OpenTextFile(sTCtempList,FORREADING)
Do Until oTextStream.AtEndOfStream
vFullName = oTextStream.ReadLine
Set oFile = FSO.GetFile(vFullName)
vName = FSO.GetFileName(oFile)
vBase = FSO.GetBaseName(oFile)
vExte = FSO.GetExtensionName(oFile)
vPath = oFile.ParentFolder
'//POSSIBLE ACTIONS:
'IF(LCase(vExte)="pdf") Then WSO.Run "sumatrapdf.exe -print-to-default """ & vFullName & """", 0, True
'//From www DOT experts-exchange DOT com/questions
' /27645053/Printing-an-Office-document-using-VBS-on-a-specified-printer.html
' Print XLS document
If (Right(strFile, 3) = "xls") Then
Set objOffice = CreateObject("Excel.Application")
objOffice.Visible = False
Set oWkbk = objOffice.Workbooks.Open(vFullName)
oWkbk.PrintOut
oWkbk.Close xlDoNotSaveChanges
objOffice.Quit
End If
' Print WORD document
If (Right(strFile, 4) = "docx") Then
Set objOffice = WScript.CreateObject("Word.Application")
objOffice.Documents.Open vFullName
objOffice.ActiveDocument.PrintOut
Wscript.Sleep(1000)
objOffice.ActiveDocument.Close
objOffice.Quit
End If
Loop
oTextStream.Close
Else
WScript.Echo "Input file sTCtempList not found."
End If
- - -
Hab' noch das hier gefunden:
http://www DOT quepublishing DOT com/articles/article.aspx?p=29570&seqNum=3Automation and Document Files
The GetObject function may be used to obtain an object that represents some already existing document file,
through a process called Automation. GetObject uses the name of the document file to find the appropriate object class server,
through the Windows standard file type association mechanism (the list of file types and applications
you see in Windows Explorer when you click Tools, Folder Options, File Types).
For example, you can create a Word document object representing an existing file and print it:
set obj = GetObject("C:\docs\userlist.doc") ' get object for existing document
obj.Printout ' print the document
set obj = Nothing ' release the object