|
rtNoteLink
rtSection
rTextRun
add (rtContainer)
addNewLine (rtContainer)
addNewLine (rTextParagraph)
appendStyle
appendText (rtContainer)
appendText (rTextParagraph)
appendText (rTextRun)
Add (rtCollection)
Add (rTextParagraph)
Bold
Borders
Clone (rtCollection)
Clone (rtFontstyle)
Clone (rtParagraphstyle)
Clone (rtStyle)
Collection (rtContainer)
Collection (rtEnumeration)
Color (rtFontstyle)
Color (rtSection)
Color (rTextRun)
Current (rTextParagraph)
DocUNID
Flags (rtSection)
Font
FontSize
getRichTextItem
hasMoreElements
isExpanded
InvisibleBorder
NDL
NextElement
NotesColor
Paragraph
SpacingBelow
Style
Title
Code fragment from sample "Doclink info in sections II"; see full running samples in downloadable help.
|
Const avis=".ndl files are used as links to notes documents from OS. The content of these files is the NDL-tagged text."
Set ctx = New rtContainer
Call ctx.getRichTextItem(doc,"Body")
Set hotcoll = ctx.Collection(PARSE_GROUP_LINKS) ' this will return only plain doclinks
Set enum = New rtEnumeration(hotcoll)

Dim o as rtNoteLink, docTarget As NotesDocument
Dim ndbTarget As NotesDatabase, vwTarget As NotesView
Dim sect As rtSection
Dim theStyle as rtStyle
Set theStyle = New rtStyle(0)
Set theStyle.Font = New rtFontStyle (0)
Set theStyle.Paragraph = New rtParagraphStyle (0)
theStyle.Font.FontSize = 12
set rtp = ctxDump.addNewLine (1)
ctxDump.appendStyle theStyle
ctxDump.appendText "Documents in RT item"
Set rtp = ctxDump.addNewLine (1) ' to change paragraph style assign returned value
' the font goes to "Current" rTextRun in paragraph object; addNewLine does not create a Text run; the next text run will inherit from paragraph
Set rtp.Style = theStyle.Clone
Set rtp.Style.Font = rtp.Style.Font.Clone
With rtp.style.Font
 .FontSize=16
 .NotesColor = Rnd*1000 Mod 128 ' some random color
 .bold=True
End With
' paragraph style applies to paragraph itself
rtp.style.Paragraph.SpacingBelow=4
' append Font style to the container, so the next text will inherit it
ctxDump.appendStyle rtp.style.Font
ctxDump.AppendText "(in sections)"
ctxDump.addnewline 1 ' section starts in new paragraph
' to have a different style we need to create a new instance
Set theStyle = New rtStyle(0)
Set theStyle.Font = New rtFontStyle (0)
Set theStyle.Paragraph = New rtParagraphStyle (0)
ctxDump.appendStyle theStyle
rtp.style.Paragraph.SpacingBelow =0
Do While enum.hasMoreElements
 Set o = enum.nextElement
 Set sect = New rtSection(0)
 With sect
  .Title = o.docUNID
  .isExpanded = False
  .InvisibleBorder = False
  .Borders = BARREC_BORDER_SHADOW
  .color.setRGB Rnd*1000 Mod 256, Rnd*1000 Mod 256, Rnd*1000 Mod 256 ' add random color
  .Flags = sect.Flags Or BARREC_HAS_COLOR
  .Content.addNewLine 1
  .Content.appendText " >>"
  .add o ' adds to current paragraph
  .appendText o.NDL
  .Content.addNewLine 2
  Set .Style = rtp.Style ' style of title - the same as header
 End With
 ctxDump.add sect
 ctxDump.addnewline 2 ' space after section
Loop
ctxDump.addNewLine 2
Set theStyle = New rtStyle(0)
Set theStyle.Font = New rtFontStyle (0)
Set theStyle.Paragraph = New rtParagraphStyle (0)
ctxDump.appendStyle theStyle
Set rtp = ctxDump.appendText (avis)
rtp.Current.style.Font.FontSize=9
rtp.Current.style.Font.NotesColor = NOTES_COLOR_RED
|
|