Solved

How to export attachments in bulk from a Lotus database?

Posted on 2008-10-29
4
5,701 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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

Technology Partners: 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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

623 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