Show ‘n Tell Thursday: Don’t rely on the default font-size (28 Sept 2006)


You should be aware of relying on the default font size of the Lotus Notes client when doing richtext programming via LotusScript. I found this out then doing an application that does the following:

  1. Grabs a document with a richtext item.
  2. Makes a copy of the backend document to do a reply-with-history style function.
  3. Remove some items in the backend and bring the document to the UI.
  4. Move focus to the richtext item and add a text like “User did function xyz at 07:41PM on 28 Sept 2006” using the InsertText method.

The problem here is that if the user just wrote an e-mail using the normal e-mail functionality where he ended the e-mail using a larger font, the text you add via LotusScript will be added using this larger font-size.

So when doing richtext programming be sure to always set the font-size or take some counter measure to avoid this behaviour.

One thought on “Show ‘n Tell Thursday: Don’t rely on the default font-size (28 Sept 2006)”

  1. I’d extend that a bit, because along with the text settings, the user could have set paragraph settings as well. Bothing like discovering that a bullet list was the end of an e-mail and your stuff was added with bullets, or that a margin was shifted, etc. Of course, these are less likely, but rich text manipulation can be tricky that way.

    Like

Comments are closed.