Domino 9 und frühere Versionen > Entwicklung

Aktionen mit Attachment ausführen

(1/1)

Don Pasquale:
Hallo Leute,

ich habe Dokumente denen eine Datei angehängt wurde ( gehen wir mal von einem Tif aus)

Diese Tifs möchte ich auf Knopfdruck
speichern, anzeigen oder ausdrucken

Das abspeichern klappt schon :

   Dim uiws As New NotesUIWorkspace
   Dim uidoc As NotesUIDocument
   Dim session As New NotesSession
   Dim doc As NotesDocument
   
   Set uidoc = uiws.CurrentDocument
   Set doc = uidoc.Document
   
   Dim Filename As String
   
   Dim rtitem As Variant  
   Set rtitem = doc.GetFirstItem( "body" )  
   If ( rtitem.Type = RICHTEXT ) Then  
      
      Forall o In rtitem.EmbeddedObjects  
         Call o.ExtractFile( "c:\temp\" & o.Source )  
      End Forall  
   End If  

Axel:
Hi,

das habe ich vor einiger Zeit im Web gefunden. Vielleicht hift es dir weiter. Getestet hab ich's allerdings noch nicht.


Axel



--- 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 ---

Don Pasquale:
Coole Sache,
ein wenig anpassen, dann klappt´s.
danke Dir

Ciao

Don Pasquale

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln