Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Chriss am 17.03.03 - 13:26:50
-
Hallo @all
ich habe da folgendes Problem:
Aus einer Ansicht in der ich x Doks habe möchte ich per doppelklick nicht das Dok selber öffnen sondern den ersten anhang (pdf-File). Soweit so gut, geht auch, doch leider bekommt der Acrobat Reader nicht den Focus sondern Notes. Soll heißen der Acrobat Reader wird gestartet, auf Notes liegt dann anschließend der Focus. Ich möchte aber erreichen das der Acrobat Reader im Vordergrund bleibt.
Hat irgend jemand eine Idee??? oder besser eine Lösung???
-
Hi,
das habe ich mal vor einiger Zeit im Web gefunden. Vielleicht hilfts dir weiter.
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
Axel
-
Hallo Axel,
danke, aber das hilft mir nicht wirklich weiter. :-(
Chriss
-
Schau dir mal meine Entwicklung - PDF Folder an.
Auf meiner Webseite unter Resourcen - Datenbanken.
Cu
Martin