Domino 9 und frühere Versionen > Entwicklung

Konzept Doc-History

<< < (4/4)

TMC:
jo, danke Jens, aber Normunds rtlib will ich nicht gleich für eine (meines Erachtens) "Kleinigkeit" einsetzen. Auch wenn Normunds das Geld Wert wäre  ;D

Ich werde es wohl über die Zwischenspeicherung lösen....

Matthias

Semeaphoros:
Denke ich auch, wollte es der Vollständigkeit halber erwähnt haben, da Search & Replace doch eigentlich ganz nützlich wären in RT-Feldern

TMC:
Danke nochmal, habe es jetzt nach dem Vorschlag von Jens getestet und klappt wunderbar.


--- Code: ---Sub Click(Source As Button)
   Dim uiws As New NotesUIWorkspace
   Dim uidoc As NotesUIDocument    
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim doc As NotesDocument
   Dim tabpos1 As Long
   Dim tabpos2 As Long
   
   Set db = session.CurrentDatabase
   Set uidoc = uiws.CurrentDocument
   Set doc = uidoc.Document    
   
   Dim rtpStyle As NotesrichTextParagraphStyle
   Set rtpStyle = session.CreateRichTextParagraphStyle
   
   Dim rti As Variant
   Set rti = doc.GetFirstItem( "Historie" )
   If ( rti.Type <> RICHTEXT ) Then Exit Sub
   
   'Linke Ränder definieren   
   rtpStyle.FirstLineLeftMargin = RULER_ONE_INCH   
   rtpStyle.LeftMargin = RULER_ONE_CENTIMETER * 7
   'Tabs definieren und setzen   
   tabpos1= RULER_ONE_CENTIMETER *5
   tabpos2= RULER_ONE_CENTIMETER *7
   Call rtpStyle.SetTab( tabpos1, TAB_LEFT)   
   Call rtpStyle.SetTab( tabpos2, TAB_LEFT)   
   'Textformatierung definieren
   Dim richStyle As NotesRichTextStyle
   Set richStyle = session.CreateRichTextStyle   
   'Paragraph-Style hinzufügen   
   Call rti.AppendParagraphStyle(rtpStyle)
   'Text in Richtextfeld setzen
   richStyle.FontSize = 8
   Call rti.AppendStyle(richStyle)      
   Call rti.AppendText(doc.Datum(0))
   Call rti.AddTab(1)
   Call rti.AppendText (doc.Version(0))
   Call rti.AddTab(1)
   Call rti.AppendText (doc.Aenderungen(0))
   Call rti.AddNewLine(1)
   
   doc.FORM = "test"
   Call doc.Save(True, False)   
   
   Call uidoc.close
End Sub
--- Ende Code ---

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln