List the image resources of a database


LotusScript


	Dim session As New NotesSession
	Dim db As notesdatabase
	Set db = session.currentdatabase
	Dim doc As notesdocument
	Set doc = session.DocumentContext
	
	Set coll = db.CreateNoteCollection(False) 
	Redim images(0) 
	i = Lbound(images) 
	coll.SelectImageResources = True 
	Call coll.BuildCollection 
	
	If Not coll Is Nothing Then 
		id = coll.GetFirstNoteId 
		While id <> "" 
			Set note = db.GetDocumentByID(id) 
			temp = note.GetItemValue("$Title") 
			If Isarray(temp) Then title = Cstr(temp(0)) Else title = Cstr(temp) 
			Redim Preserve images(i) 
			images(i) = title 
			i = i+1 
			id = coll.GetNextNoteId(id) 
		Wend 
	End If 

print Join(images, Chr$(10))

Posted by fbrefere001 on Tuesday September 18, 2012