Solved

How to export attachments in bulk from a Lotus database?

Posted on 2008-10-29
4
4,953 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 63

Expert Comment

by:SysExpert
ID: 22835099
0
 
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 250 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Creating a new theme in discussion8.ntf 6 160
Switching from Lotus Notes to Outlook 4 48
See used databases in Domino 8 102
DNS error assumed 8 58
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

776 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