Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: mkrauss am 18.05.07 - 09:15:20

Titel: Anhang aus Richtextfeld drucken
Beitrag von: mkrauss am 18.05.07 - 09:15:20
Hallo alle zusammen,

wir habe eine Maske in der erst mal alles mögliche gemacht werden kann.
Unter anderem haben wir ein Richtextfeld, in welchem die User auch Word Doc's als Anhänge abspeichern. Nun möchten die User eine Möglichkeit haben, diese Wordanhänge zu drucken ohne diese erst im Word öffnen zu müssen.

Habe da leider noch keine Idee wie man dies am besten umsetzen könnte.
Hättet ihr mir hierfür eine Idee oder Lösungsvorschlag??
Titel: Re: Anhang aus Richtextfeld drucken
Beitrag von: eknori am 18.05.07 - 09:21:43
siehe: http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/b58515b744135ae38525703800527812?OpenDocument
Titel: Re: Anhang aus Richtextfeld drucken
Beitrag von: Axel am 18.05.07 - 09:28:16
Das hier hab ich vor längerer Zeit mal im Web gefunden:

Zitat
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


Axel