Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to export attachments in bulk from a Lotus database?

Posted on 2008-10-29
4
Medium Priority
?
6,202 Views
Last Modified: 2013-12-18
Switching from a Lotus based contact manager, to Salesforce and need to be able to export fields with attachments and have those attachments be preserved so that they can be imported into Salesforce.

Are there any tools that can do this?  Have tried the NotesSQL 8.0 ODBC Drivers and can't seem to isolate the attachments.
0
Comment
Question by:WrecklessOne
4 Comments
 
LVL 3

Expert Comment

by:rd153
ID: 22937842
It should be fairly simple to write something in LotusScript which would do this
0
 
LVL 5

Accepted Solution

by:
mekhet30 earned 750 total points
ID: 22947881
You can create an agent in the database that will do this for you.

Here is code that I have used before:

What you need to do is create a view in the db that has all the documents sorted by first column and you need the name of the field that contains the attachments

View e.g. AllDocumentsByForm
Field e.g. attachments

Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim nextdoc as notesdocument
Dim dirpath As String
Dim view As NotesView
Dim fullpath As String
      
Set db = session.CurrentDatabase
Set view = db.GetView("AllDocumentsByForm")
Set doc = view.GetFirstDocument

 Dim num As Integer
 dirpath = "c:\Images"
 If (Dir$ (dirpath, 16) = "") Then
  Mkdir dirpath
End If

While not doc is nothing
set nextdoc = view.getnextdocument(db)
            
 '-- Loop through all attachments in document and detach to Notes Data Directory
      Dim rtitem As Variant    
      Set rtitem = doc.GetFirstItem( "attachments" )
                  
'-- if array of embedded objects exist then detach all attachments into the Notes Data directory
      If Isarray( rtitem.EmbeddedObjects ) Then
            Forall o In rtitem.EmbeddedObjects
                  If ( o.Type = EMBED_ATTACHMENT ) Then
                        fullpath = dirpath & "\" & o.source                        
                                    
                        Call o.ExtractFile( fullpath )    
                                    
                  End If
            End Forall
        end if

set doc = nextdoc
Wend
End Sub


NOTE:  If any attachments have the same name, then they will be overwritten.  The code can be adjusted to avoid this

Cheers
0
 

Author Comment

by:WrecklessOne
ID: 23122602
The solution ended up being a manual one, since we needed to ensure that each attachment, not only maintained it's original name, but that when brought into the new system the proper relationship between the attachment and the document is was being attached to was also maintained.

Thanks all!

Georges
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question