Thanx for ansering me. I've already developed a code, but it does not work properly with exceptions. Can you put your code in front, so that I can use it?
sPathToSave = "Destination Path"
Dim View As Object 'New Domino.NotesView
Dim nDoc As Object 'Domino.NotesDocument
Const RICHTEXT = 1
Const EMBED_ATTACHMENT = 1454
Set s = CreateObject("Notes.Notessession" 'create notes session
Set db = s.GETDATABASE("", "" 'set db to database not yet named
Call db.openmail
Set View = db.GetView("($Inbox)"
Set nDoc = View.GetFirstDocument
Dim itm As Variant
While Not (nDoc Is Nothing)
If nDoc.HasEmbedded Then
Set itm = nDoc.GetFirstItem("Body"
If itm.Type = RICHTEXT Then
Dim attch As Variant
For Each attch In itm.EmbeddedObjects
If (attch.Type = EMBED_ATTACHMENT) Then
attch.ExtractFile sPathToSave & attch.Name
End If
Next
End If
' Following code commented is used to delete mails after
' attachments were saved to disk.
'Set nDoc2Remove = nDoc
End If
Set nDoc = View.GetNextDocument(nDoc)
' Following code commented is used to delete mails after
' attachments were saved to disk
'If Not (nDoc2Remove Is Nothing) Then
' nDoc2Remove.Remove (True)
' Set nDoc2Remove = Nothing
'End If
Wend
End Sub
Additionals:
This sets it look in a sub folder:
Set View = db.GETVIEW("Sub Folder"'replace the getview in the code
Moves to another folder, (actually moves a shortcut, remains in original folder):
ndoc.PutInFolder( "New Folder" )
And to remove from existing:
ndoc.RemovefromFolder( "Old Folder" )
Specify a specific db within notes:
Set db = s.GETDATABASE("server", "full address of mail box as in propetys"
so mine looks like
Set db = s.GETDATABASE("Orwell", "Mail\CS\Repoteam.nsf"
I've got a help file for Notes Sessions from VBA which should answer any questions. If you want it, mail a request to colin@kylua.com and I'll send it out to you
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.