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...
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.
Just too cool!
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)
provided by Julian Robichaux at nsftools.com.



Comments
Posted by Duffbert At 06:59:20 On 11/02/2005 | - Website - |
(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)
Posted by Ben Langhinrichs At 06:31:10 On 11/02/2005 | - Website - |