Domino 9 und frühere Versionen > ND6: Entwicklung
Feld erzeugen in LS
Nexus:
Dim docDB1 As NotesDocument
Dim db1 As NotesDatabase
Dim session As New NotesSession
Dim searchview1 As NotesView
Set db1 = session.GetDatabase( "", "c:\Dokumente und Einstellungen\Markus\Eigene Dateien\Notes\vergleich\VergleichDB1.nsf" )
Set searchview1=db1.GetView("Groups")
Set docdb1= searchview1.GetNextDocument(docdb1)
' call docdb1.errdescription = "Test Test"
In das docdb1 Dokument möchte ich ein Feld erzeugen.
Aber mit deinem Vorschlag, bleibt die Zeile rot.
Kann sein, dass ich errdescription als Notesitem definieren muss ?
Driri:
Lies doch mal genau, was rar geschrieben hat. Wo siehst Du denn da ein "Call".
Und anzumerken ist, Du mußt das Dokument dann auf jeden Fall mit Save speichern.
Nexus:
verdammt stimmt. Ahh... hab in der letzten Zeit viel Call verwenden müssen. Ist ja keine Klasse. Ok. Fehler gefunden.
thx
Glombi:
Die Lösung von rar nennt sich übrigens "Extended Class" Syntax"
Aus der Hilfe:
"Extended class" syntax
You can also change an item's value using the NotesDocument "extended class" syntax, which eliminates the need for ReplaceItemValue. For example, you have the following script:
Dim item As NotesItem
Set item = doc.ReplaceItemValue _
( "Subject", "Update on stock options" )
Call doc.Save( False, True )
You can achieve the same result by doing the following:
doc.Subject = "Update on stock options"
Call doc.Save( False, True )
This syntax lets you treat NotesDocument as an "extended class" by using an item name as if it were a property of NotesDocument. In the example above, "Subject" is used as if it is a property of the NotesDocument class. The result is the same as if you used ReplaceItemValue, except that ReplaceItemValue returns a NotesItem object representing the item you just created, and the IsSummary property defaults to True.
Es sei darauf hingewiesen, dass die Performance schlecht im Vergleich zu ReplaceItemValue ist (dafür hat der Programmierer weniger zu tippen).
Andreas
Thomas Schulte:
Deswegen sollte man AppendItemValue immer nur in Verbindung mit hasitem zusammen benutzen. wenn man in eine bereits vorhandenes Item reinschreiben will. Dafür ist das Dingens nämlich da.
Thomas
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln