Hi,
ich möchte ein Array prüfen. Falls ein Index mit einem bestimmten Wert beginnt, möchte ich diesen löschen und dann das Arrays neu dimensionieren.
Dim session As New NotesSession
Dim db As notesdatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim i As Integer
Dim strSoftwareEntry As String
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()
While Not(doc Is Nothing)
For i = Lbound(doc.Feld) To Ubound(doc.Feld)
strSoftwareEntry = Left$(doc.Feld(i), 9)
If strSoftwareEntry = "Wert" Then _
doc.Feld(i) = ""
Next
Redim doc.Feld(i) As String
Call doc.Save( True, True )
Set doc = collection.GetNextDocument(doc)
Wend
Leider erhalte ich beim Löschen des Indexes (genauer beim Ändern in "") den Fehler "Illegal use of PROPERTY".
Wißt ihr, warum? Danke schonmal im voraus.
cu
Sebastian
Danke Euch allen, für die Hilfe.
Mein Code sieht jetzt so aus:
Dim session As New NotesSession
Dim db As notesdatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim i As Integer
Dim strSoftwareEntry As String
Dim result As Variant
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()
While Not(doc Is Nothing)
For i = Lbound(doc.Feld) To Ubound(doc.Feld)
strSoftwareEntry = doc.Feld(i)
If Left$(strSoftwareEntry, 9) = "Wert" Then _
result =Fulltrim(Arrayreplace(doc.Feld, strSoftwareEntry , ""))
Next
doc.Feld = result
Call doc.Save( True, True )
Set doc = collection.GetNextDocument(doc)
Wend
Und das Beste: er macht das, was ich will.
cu
Sebastian