Domino 9 und frühere Versionen > ND6: Entwicklung

Tipp zur Umsetzung eines Links zum Kontakt

<< < (5/7) > >>

dabjoern:
Hi Axel und natürlich auch die anderen,
das ist eine gute Idee. Aber ich hab jetzt in der Hilfe nochmal nachgelesen und mich mit getFirstItem, GetItemValue und FieldGetText beschäftigt. Ich verstehe, welche Klassen vorausgesetzt werden. Was mich verwundert, ist das folgender Code nicht funktionsfähig ist.


--- Code: ---Dim session As New NotesSession
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim ws As New NotesUIWorkspace
Dim doc As NotesDocument

Set db = session.CurrentDatabase
Set uidoc = ws.CurrentDocument

Call uidoc.Save
Set doc = uidoc.Document
Set rtitem = doc.GetFirstItem("SO_Name_1")
--- Ende Code ---

Der Fehler ist: Type Mismatch in der letzten Zeile bei set rtitem. Es handelt sich doch bei doc um ein NotesDocument, welches die Methode GetFirstItem unterstützt. Ich finde in NotesUIDocument keine alternative Methode. Also, was machen? Sorry für die vielen Fragen und tausend Dank!

Gruß
Björn

Axel:
Hi,

du musst die Variable rtitem auch deklarieren.

Dim rtitem As NotesRichTextItem


Axel

dabjoern:
Die habe ich so, wie du vorschlägst, deklariert. Habe den Code nur ausschnittsweise gepostet. Hier nochmal mein Testcode:


--- Code: ---Sub Postrecalc(Source As Notesuidocument)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim uidoc As NotesUIDocument
Dim ws As New NotesUIWorkspace
Dim doc As NotesDocument
Dim ldoc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim key As Variant
Dim counter As Integer

Set db = session.CurrentDatabase
Set uidoc = ws.CurrentDocument

Call uidoc.Save
Set doc = uidoc.Document
Set rtitem = doc.GetFirstItem("SO_Name_1")

counter = uidoc.FieldGetText("EB_counter")

For i = 1 To counter
key = uidoc.FieldGetText(("SO_Name_" + Cstr(i)))
Messagebox(key)
Next i
End Sub
--- Ende Code ---

Gruß
Björn

Axel:
Hi,

ja und..., läuft?


Axel

dabjoern:
Hi auch,
Sorry, Missverständnis. Ich hatte den Code schon so. Er läuft nicht. Immer wieder Type Mismatch Fehler.
Gruß
Björn

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln