Non tutti sanno che l'icona che rappresenta
un DATABASE notes, è salvata in un documento Notes con uno SPECIAL FIELD
chiamato "IconBitmap"...
Il database in Allegato permette di
cambiare dinamicamente l'ICONA al database richiamando un agente LS. Provatelo!
Eccovi il codice:
********************
Dim session As New NotesSession
Dim
currDb As NotesDatabase
Dim
iconDoc As NotesDocument
Dim
iconColl As NotesDocumentCollection
Dim
newIconDoc As NotesDocument
Dim
item As NotesItem
Set
currDb = session.CurrentDatabase
Set
iconDoc = currDb.GetDocumentById("13E")
If
iconDoc Is Nothing Then Exit Sub
Set
iconColl = currDb.UnprocessedDocuments
If
iconColl.Count <> 1 Then
Print "Must have only 1 document selected.
Icon not switched."
Exit Sub
End
If
Set
newIconDoc = iconColl.GetFirstDocument
If
newIconDoc Is Nothing Then Exit Sub
If
Not newIconDoc.HasItem("IconBitmap") Then
Print "Selected document not formatted
correctly. Icon not switched."
Exit Sub
End
If
Call
iconDoc.RemoveItem("IconBitmap")
Set
item = newIconDoc.GetFirstItem("IconBitmap")
If
item Is Nothing Then Exit Sub
Call
item.CopyItemToDocument(iconDoc, "IconBitmap")
Call
icondoc.Save(True, True, True)
If
newIconDoc.HasItem("Descr") Then
Print "Icon switched to " &
newIconDoc.GetItemValue("Descr")(0) & "."
Else
Print "Icon switched."
End
If
********************
Cambiare ICONA al database dinamicamente con LS
- 05/24/2005
- 0 commenti
0 Commenti:
Nessun Commento Trovato