Autor Thema: Arial in RichTextItem  (Gelesen 3686 mal)

TomLudwig

  • Gast
Arial in RichTextItem
« am: 16.12.03 - 16:04:17 »
Hallo,

wie kann ich per LS einem Style, der wiederum dann in ein RichTextItem eingebunden wird, die Schriftart "Arial" zuweisen.

Laut Designer Hilfe gehen nur 4 Schriftarten:

FONT_COURIER (4)
FONT_HELV (1)
FONT_ROMAN (0)
STYLE_NO_CHANGE (255)

Danke!

Offline meichhorner

  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 616
  • Geschlecht: Männlich
    • Webseite von Martin Eichhorner
Re:Arial in RichTextItem
« Antwort #1 am: 16.12.03 - 17:50:54 »
Hy,

auch mal in der Hilfe ne Seite weitergeblättert  ;D ;)

Zitat
Example
Returns an identifier for a font face in a document.
Note  This method is new with Release 6.
Defined in
NotesRichTextItem
Syntax
notesFont% = notesRichTextItem.GetFormattedText( 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.
Language cross-reference
@FontList function in formula language
Example
See Also
Working with text in LotusScript classes


Code
This agent creates a document with a rich text item with three lines of text in different fonts.
Dim session As NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rti As NotesRichTextItem
Dim style As NotesRichTextStyle

Sub Initialize
  Set session = New NotesSession
  Set db = session.CurrentDatabase
  Set doc = New NotesDocument(db)
  Call doc.ReplaceItemValue("Form", "Main Topic")
  Call doc.ReplaceItemValue("Subject", "Three fonts")
  Set rti = New NotesRichTextItem(doc, "Body")
  Set style = session.CreateRichTextStyle
  style.NotesFont = rti.GetNotesFont("Times", True)
  Call rti.AppendStyle(style)
  Call rti.AppendText("This text is in Times.")
  Call rti.AddNewLine(2)    
  style.NotesFont = rti.GetNotesFont("Courier", True)
  Call rti.AppendStyle(style)
  Call rti.AppendText("This text is in Courier.")
  Call rti.AddNewLine(2)    
  style.NotesFont = rti.GetNotesFont("Arial", True)
  Call rti.AppendStyle(style)
  Call rti.AppendText("This text is Arial.")
  Call doc.Save(True, True)
End Sub

Cu
Martin

Martin Eichhorner
Schulungen zu Lotus Notes Domino 5 & 6 z.B. Westösterreich(A), Ostschweiz(CH), Bodenseeraum(D)
Tip´s, Trick´s, Tools und eine große Linksammlung findest du unter
http://www.eimsolution.net

TomLudwig

  • Gast
Re:Arial in RichTextItem
« Antwort #2 am: 17.12.03 - 08:21:15 »
Gut, danke...

und wieder sieht man einmal... erst lesen dann fragen... sorry....



 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz