Manage Learn to apply best practices and optimize your operations.

Dynamically change background color of a Notes doc

This tip allows you to change background color on the fly by the user choosing the color on the form itself.

Many people know about the $PaperColor field that allows you to change the background of a document. The drawbacks are that you have to close and re-open the document to see the change. Also, you are stuck with the 239 (or so) color numbers. This tip allows you to change it on the fly by choosing the color on the form itself.

  1. First, create a field of color type -- let's call the field DocColor.
  2. Then, below it create a button of JavaScript formula type.
  3. In the code, type the following JavaScript:
    document.bgColor = document.forms[0].DocColor.value.substr (2,6)

This tip will only work in ND6, because of the color field type. The idea could be scaled back to work just with the JavaScript portion, though, to make it work with R5.

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

This tip was submitted to the tip exchange by member Malcolm MacLeod. 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 JavaScript for Lotus Notes Domino

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...