Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: mariab am 08.05.06 - 09:51:39

Titel: Tabelle erstellen mittels LS
Beitrag von: mariab am 08.05.06 - 09:51:39
Hallo,

habe eine Maske in welcher ich eine Schaltfläche zum erstellen einer Tabelle mittels LS habe und ein Feld Body.

Hier der Code:
Code
Sub Click(Source As Button)
	Dim session As New NotesSession
	Dim db As NotesDatabase	
	Set db = session.CurrentDatabase
	Dim ws As New NotesUIWorkspace
	Dim uidoc As NotesUIDocument
	Dim doc As NotesDocument
	Dim rtitem As Notesrichtextitem
	Set uidoc = ws.CurrentDocument
	Set doc = uidoc.Document
	Set rtitem = doc.GetFirstItem( "Body" )
	Call uidoc.Save
	Call rtitem.appendtable( 1,1 )
End Sub

wenn ich den Code ausführe erhalte ich die Meldung "Object Variable not Set". Drücke ich nochmals auf die Schaltfläche so erscheint keine Fehlermeldung mehr. Warum?
Titel: Re: Tabelle erstellen mittels LS
Beitrag von: ZaLudtske am 08.05.06 - 10:10:35
Hallo,

das Feld "Body" existiert zum Zeitpunkt des Zugriffs noch nicht. (Der Zugriffper GetFirstItem funktioniert nicht.)

Bitte zuerst das RichtextItem mit der Methode CreateRichtextItem erstellen und dann darauf zugreifen.

R.