Solved

How to export attachments in bulk from a Lotus database?

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now