Manage Learn to apply best practices and optimize your operations.

Upload images into selected documents

This tip shows you how to import multiple images into a set of selected documents from a folder.

This tip shows you how to import multiple images into a set of selected documents from a folder.

Write the code given below in an agent and call the agent. In this example the image whose file name is the same as that of the name field in the document is imported. The name field can be changed to any field in the document.

Sub Initialize
 Dim workspace As New NotesUIWorkspace
 Dim uidoc As NotesUIDocument
 Dim session As New NotesSession
 Dim db As NotesDatabase
 Dim collection As NotesDocumentCollection
 Dim nme As Variant
 Dim doc As NotesDocument    
 Dim view As NotesUIView 
 Dim view1 As notesview
 
 Dim m As Integer
 Set db = session.CurrentDatabase
 Set view = workspace.CurrentView
 Set view1 = db.GetView( view.viewname )
 Set collection = db.UnprocessedDocuments
 Filename1=workspace.openfiledialog(False)
 If Isempty(Filename1) Then Exit Sub
 actfilename=Strleftback( Filename1(0),"")
 
 Set doc = collection.GetFirstDocument
 
 While Not Doc Is Nothing
  nme = doc.Name(0)
  filename =actfilename  &"" & nme &".jpg"
  Set uidoc = workspace.
EditDocument( True, doc ) ' 
  Call uidoc.GotoField("Picture")
  Call uidoc.Import("JPEG Image", filename)
  Call uidoc.Save
  Call uidoc.Close
  Set doc = collection.
getnextdocument (doc)
  m=m+1
 Wend
 End Sub

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member Pamela. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Dig Deeper on LotusScript

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close