Script Agent to Run on Views to Set View Properties

Has anyone attempted to use the NotesView, NotesColor Classes to update the design properties of Views? According to the documentation you can get or set the Background color of a view. We have instituted some standards for views and if the rework could be done by an agent running on the views it would be better than manually going to each view and the properties.

Subject: Script Agent to Run on Views to Set View Properties

Sub Initialize On Error Goto errhand

Dim w As New notesuiworkspace

Dim db As notesdatabase

Dim v As notesview



Set db = w.currentdatabase.database

Forall vw In db.views

	vw.BackgroundColor = COLOR_YELLOW

End Forall

Exit Sub

errhand:

Msgbox "error at line " & Erl & ": " & Error

Exit Sub

End Sub

Subject: RE: Script Agent to Run on Views to Set View Properties

Thanks for the reply. I found a nice hint on getting all 400 colors in the Designer Help.

I tried your code on a lcoal test database with My Client. The Lotus Red Square of Death appeared. I’ll play around some more.