About Duffbert...

Duffbert's Random Musings is a blog where I talk about whatever happens to be running through my head at any given moment... I'm Thomas Duff, and you can find out more about me here...

Email Me!

Search This Site!

Custom Search

I'm published!

Co-author of the book IBM Lotus Sametime 8 Essentials: A User's Guide
SametimeBookCoverImage.jpg

Purchase on Amazon

Co-author of the book IBM Sametime 8.5.2 Administration Guide
SametimeAdminBookCoverImage.jpg

Purchase on Amazon

MiscLinks

Visitor Count...



View My Stats

« Book Review - Internet Annoyances by Preston Gralla | Main| Are Google click-thru's for asbestos really that high? »

A new ND6 NotesRichTextItem method... GetNotesFont

Category Software Development
OK... I'm a little slow...

(You in the back row! That's enough of the "a little slow what?" comments!)

One thing I like to do in agents that send out emails is to use the NotesRichTextStyle class to do formatting like bolding, font sizing, etc. But what I've always disliked is that for font faces, you are pretty much restricted to Helv, Roman, and Courier. I was looking through the Designer Help for formatting on something, and I ran across a new method in NotesRichTextItem called GetNotesFont. What it allows you to do is get a reference to another font type and use that instead...

Returns an identifier for a font face in a document.
Note: This method is new with Release 6.

Syntax
notesFont% = notesRichTextItem.GetNotesFont( faceName$, addOnFail )

Parameters
faceName$
String. The name of the font face, which must be valid for the platform on which the agent is running.
addOnFail
Boolean.
True assigns an identifier for the font face if one is not already assigned in the current document.
False (default) returns 0 if an identifier is not assigned for the font face in the current document.

Return value
notesFont%
Integer. The identifier associated with the specified font face, or 0.

Usage
The identifier can be used to set NotesFont in NotesRichTextStyle.
Identifiers assigned by GetNotesFont are in the range 5 through 254.

So, since I like Georgia fonts, I decided to send out this particular email set in Georgia, like so...

'Set a style for the text in the email. Set rtsText = session.CreateRichTextStyle() rtsText.FontSize = 11 rtsText.Italic = False rtsText.Bold = False rtsText.NotesFont = rtiBody.GetNotesFont("Georgia", True) Call rtiBody.AppendStyle(rtsText)
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.
Just too cool!

Comments

Gravatar Image1 - OK... I'm a "little slow" something... Lotus is a "big slow" something...

Gravatar Image2 -
(Can't resist. - Granted you could do this in Midas for Notes R4.1 in 1997 and in @YourCommand Toolkit for Notes 3.3, it is still a wonderful thing. Maybe in ND14 they will give you the ability to sort a table)

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Want to support this blog or just say thanks?

When you shop Amazon, start your shopping experience here.

When you do that, all your purchases during that session earn me an affiliate commission via the Amazon Affiliate program. You don't have to buy the book I linked you to (although I wouldn't complain!). Simply use that as your starting point.

Thanks!

Thomas "Duffbert" Duff

Ads of Relevance...