Domino 9 und frühere Versionen > Entwicklung

Direktes Drucken eines Anhanges aus einer Maske

(1/1)

Sabine:
Hallo alle zusammen,

hat jemand ein Script (oder auch Formel) geschrieben, mit der man direkt einen Anhang ausdrucken kann, ohne diesen vorher öffnen zu müssen?

Herzlichen Dank...

Axel:
Hi,

das habe ich vor einiger Zeit mal im internet gefunden. Vielleicht ist das was für dich.


--- Zitat ---Printing attachments based on types

This is to print attachments in rich text fields based on their types and without user intervention.It can print, any
no of attachments in a rtf with just one click.For windows based lotus notes
   
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(Byval hwnd As Long, Byval lpszOp As String, _
Byval lpszFile As String, Byval lpszParams As String, _
Byval LpszDir As String, Byval FsShowCmd As Long) As Long
Declare Private Function GetDesktopWindow Lib "user32" () As Long
Private Const SW_HIDE = 0&
Dim ritem As Variant
Dim Scr_hDC As Long
Dim ret As Long
Dim file As String

Sub PrintAttachment(doc As NotesDocument)
Dim ritem As Variant
Dim Scr_hDC As Long
Dim ret As Long
Dim file As String

Set ritem=doc.getfirstitem("Body")
If (ritem.type=RICHTEXT)Then
If Isarray(ritem.embeddedobjects) Then
Forall o In ritem.embeddedobjects
If (o.type=EMBED_ATTACHMENT) Then

Call o.extractfile (o.name)

extname=Right$(o.name,3)

If extname="tml" Or extname="TML" Then
extname=Right$(o.name,4)
End If

varobject = o.object
If extname="DOC" Or extname="doc" Then
file=o.name
Call o.ExtractFile( "c:\temp\" & file )
Scr_hDC = GetDesktopWindow()
ret = shellExecute(Scr_hDC, "print",file ,Null ,"c:\temp" ,SW_HIDE)
End If

If extname="XLS" Or extname="xls"Then
file=o.name
Call o.ExtractFile( "c:\temp\" & file )
Scr_hDC = GetDesktopWindow()
ret = shellExecute(Scr_hDC, "print",file ,Null ,"c:\temp" ,SW_HIDE)
End If

if extname="PPT" Or extname="ppt"Then
file=o.name
Call o.ExtractFile( "c:\temp\" & file )
Scr_hDC = GetDesktopWindow()
ret = shellExecute(Scr_hDC, "print",file ,Null ,"c:\temp" ,SW_HIDE)
End If

If extname="TXT" Or extname="txt"Then
file=o.name
Call o.ExtractFile( "c:\temp\" & file )
Scr_hDC = GetDesktopWindow()
ret = shellExecute(Scr_hDC, "print",file ,Null ,"c:\temp" ,SW_HIDE)
End If

If extname="PDF" Or extname="pdf"Then
file=o.name
Call o.ExtractFile( "c:\temp\" & file )
Scr_hDC = GetDesktopWindow()
ret = shellExecute(Scr_hDC, "print",file ,Null ,"c:\temp" ,SW_HIDE)
End If

If extname="HTML" Or extname="html"Then
file=o.name
call o.ExtractFile( "c:\temp\" & file )
Scr_hDC = GetDesktopWindow()
ret = shellExecute(Scr_hDC, "print",file ,Null ,"c:\temp" ,SW_HIDE)
End If

If extname="TIF" Or extname="tif"Then
file=o.name
Call o.ExtractFile( "c:\temp\" & file )
Scr_hDC = GetDesktopWindow()
ret = shellExecute(Scr_hDC, "print",file ,Null ,"c:\temp" ,SW_HIDE)
End If

End If
End Forall
End If
End If


End Sub

--- Ende Zitat ---

Klafu:
Hallo,

Nur um den Thread noch ein wenig zu erweitern:
könnte noch jemand erklären, wie ich beim Print einen Drucker definiere Bzw. einen Netzwerkdrucker?
Bei mir klappt es nicht wirklich. Hab da aber auch keine große Erfahrung

Chris

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln