Programmatically Changing Database Icons

xiaoxiao2021-03-06  83

Are you one of those people who have not gotten away from the workspace in Notes 5 or 6? If so, you've probably come to love the little icons on each of the databases. This tip shows you how to programmatically change the icon using LotusScript by creating a nightly agent, so each day your users will have a new icon to see. you could even set it up so the icon is changed every time you open the database. Think this is stupid? I can tell you from experience That Implementing this Makes Uses Want To Go Into the Database. They Want To See What The "icon of the day" is, and then the virtid upread information in the database.

There are three things you'll need to know in order to change the database icon. First, you need to know that the icon is actually a Notes document (just like every design element) so it can be manipulated like any Notes document. Second , The Actual Picture Is Stored In A Special Field Called

IconBitmap. Third, you need to know the location (in the database) of the icon so you can get it and manipulate it. That location varies from database to database. There are ways in Notes 4 and 5 to find the location programmatically using the Notes API. Notes 6 introduced a new way using the new NotesNoteCollection class. But that is actually overkill for this exercise, because the location of the icon, once the database has been created, is fixed. So you just need to look it up once And set the value. if you want to make this script generic and portable, the you can ing..........................

To look up the location of the icon document, in notes 5 go to

Resources / Other in The Designer Client, or in Notes 6 Go Toother / Database Resources. Highlight The icon (Don't Double-Click on It Like You "and going to edit it) and go to design proties. Go to the last tab The "beanie") as seen in

Figure 1, And make a note of the document ID (The Value Starting with "NT"). This is a hex value, and this is the location of the icon document within the database. That What You'll Need To Get A Handle To the design element as a document.

Next, You'll NEED SOURCE DATABASE ICONS in The Right Format. (That

IconBitmap field is a special format, so you need to duplicate that). Luckily for you, I've done the work and you can