Nun ja, mit ein bisschen Script programmierung ist das möglich. Schliesslich arbeiten wir mit Notes 8)und da braucht man i.d.R kein Zusatztool, wenn mal eine Funktionalität fehlt.
hier mal die Lösung meines amerikanischen Kollegen
Hier ist zwar der Pfad statisch,; das läßt sich aber leicht ändern.
by Brad Pitt ( der heißt wirklich so
)
The following code will allow your users to more effectively manage their attachments. We have found that in our organization, most of the used disk space in mail files is due to attachments that users have forgotten to delete in their mail file. This code will make it a lot easier for them by allowing them to go to an attachments view, which displays only messages with attachments (obviously) and allows them to select any number of messages and click a button to delete all attachments from the messages.
You can customize the location where the attachments are stored, I chose c:\My Documents\Notes Attachments
If a user downloads a file that already exists in that directory, it will ask them if they want to overwrite the file, create a new file name with a number appended to the filename (dismore.txt will be called dismore1.txt, if they download it again it will be called dismore2.txt), or cancel the entire operation.
In place of the attachments in the message, it tells them where the file was downloaded to and what the file was called.
Rich Text: Create a view called "Attachments". This view is catagorized by date and shows who sent the attachment, the subject of the message, and a column with the following formula - @AttachmentNames + "=" + @Text(@Round(@AttachmentLengths/1024)) + " Kb\'s" + " "
I also have a total MB column set to total with the following formula - @Sum(@Round(@AttachmentLengths/1024000))
Create an action button in this view that calls the following agent..... I called the agent (Download Attachments). The code for the action button is as follows:
answer := @Prompt([YESNO]; "Download selected attachments?"; "Would you like to download all attachments from the selected documents to the c:\\My Documents\\Notes Attachments\\ directory on your computer?");
@If(answer = 1; @Command([ToolsRunMacro];"(Download Attachments)"); @Return(""))
The agent is setup like the following:
---Initialize Event---
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim dc As NotesDocumentCollection
Dim answer As Integer
Dim rtitem As Variant
Dim attachname As String
Dim filename As String
Dim extension As String
Dim checkname As String
Dim newname As String
Dim x As Integer
On Error Resume Next
Mkdir "c:\My Documents"
Mkdir "c:\My Documents\Notes Attachments"
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
x = 0
Do Until Doc Is Nothing
Set rtitem = doc.GetFirstItem( "Body" )
' Goes to the body field and finds all attachments
If ( rtitem.Type = RICHTEXT ) Then
Forall obj In rtitem.EmbeddedObjects
If ( obj.Type = EMBED_ATTACHMENT ) Then
' If a duplicate file name is found, ask the user whether they would like to overwrite , update name, or cancel entire operation
If( Dir$("c:\My Documents\Notes Attachments\" & obj.Source)) <> "" Then
attachname = obj.source
answer = Msgbox ("This folder already contains a file named " & attachname & ". " & Chr(10) & "Would you like to create a new file name for this file in the format 'filenameX'? " & Chr(10) & Chr(10) & "If you choose yes, a new file name will be created. " & Chr(10) & "If you choose no, the file will be overwritten with this attachment. " & Chr(10) & "The cancel button will stop the download process for the rest of the selected documents." , 547, "Warning!" )
' 2= cancel, 7= No (overwrite), 6= Yes (update name)
Else
attachname = obj.source
Call obj.ExtractFile( "c:\My Documents\Notes Attachments\" & attachname )
Call obj.Remove
Call rtitem.AddNewLine( 2 )
Call rtitem.AppendText(( "Your file was downloaded to c:\My Documents\Notes Attachments\ as filename: " ) & attachname)
Call doc.Save( False, True )
answer = 0
End If
If( answer = 2 ) Then ' User has chosen to cancel
Exit Sub
End If
If( answer = 7 ) Then ' User has chosen to overwrite existing file
' Downloads file name and overwrites the attachment with the same name
Call obj.ExtractFile( "c:\My Documents\Notes Attachments\" & attachname )
Call obj.Remove
Call rtitem.AddNewLine( 2 )
Call rtitem.AppendText(( "Your file was downloaded to c:\My Documents\Notes Attachments\ as filename: " ) & attachname)
Call doc.Save( False, True )
answer = 0
End If
If( answer = 6 ) Then ' User has chosen to download with new name
' Gets everything to the left and right of the file name and puts them in variables
filename = sLeft( attachname, "." )
extension = "." & sRight( attachname, "." )
newname = attachname
' Loop until you find unique file name - Dir command returns "" if file name is not found in specified directoty
Do While (Dir$("c:\My Documents\Notes Attachments\" & newname)) <> ""
' Adds next sequential number to the end of the file name - then puts them all together as newname
x=x+1
newname = filename & Cstr(x) & extension
Loop
' Once you have unique file name - download with new name
Call obj.ExtractFile( "c:\My Documents\Notes Attachments\" & newname )
Call obj.Remove
Call rtitem.AddNewLine( 2 )
Call rtitem.AppendText(( "Your file was downloaded to c:\My Documents\Notes Attachments\ as filename: " ) & newname)
Call doc.Save( False, True )
answer = 0
End If
End If
End Forall
End If
answer = 0
Set doc = dc.GetNextDocument(doc)
Loop
End Sub
Create this functions in the agent:
----sLeft-----
Function sLeft ( sourceString As String, searchString As String ) As String
pos% = Instr ( sourceString, searchString )
If pos% > 0 Then pos% = pos% -1
sLeft = Left ( sourceString, pos%)
End Function
----sRight-----
Function sRight ( sourceString As String, searchString As String) As String
pos% = Instr ( sourceString, searchString )
length% = Len ( sourceString )
start% = length% - pos%
sRight = Right ( sourceString, start% )
End Function