Also, ich hab das so weit gelöst, dass ich den Typ des Feldes abfrage und je nachdem die Feldwerte hole, unabhängig davon ob der Wert jetzt aktuell ist oder nicht (RichTextFeld).
So jetzt will ich die beiden Werte vergleichen, aber egal was ich mache die Funktion Strcompare gibt nie "0 " also, gleich zurück.
Im debugger sind die Werte aber identisch
Das is der Code:
Dim workspace As New NotesUIWorkspace
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim nam As NotesName
Dim p_status,author As Variant
Dim item As NotesItem
Dim firstsplit,finalsplit,erg_firstsplit,history_erg As String
Dim lastmodified,historystring, history,historyfield,historycontent,history_erg_help As String
Dim fieldcontent,fieldcontent_help As String
Dim itype As Long
Dim count As Integer
Set db = s.CurrentDatabase
Set doc=Source.Document
historyfield=fieldname &"_History"
historycontent=Source.FieldGetText(historyfield)
Set item=doc.GetFirstItem(fieldname)
itype=item.Type
'rich text field
If itype=1 Then
fieldcontent=Cstr(item.text)
'text field
Elseif itype=1280 Then
fieldcontent=Cstr(Source.FieldGetText(fieldname))
Else
fieldcontent=""
End If
'emliminate all blanks and new lines
fieldcontent_help=Cstr(Replace(fieldcontent,Chr$(13),""))
fieldcontent_help=Cstr(Replace(fieldcontent_help," ",""))
fieldcontent_help=Cstr(Replace(fieldcontent_help,";",""))
If historycontent="" Then
Set nam=s.CreateName(s.UserName)
author=nam.Common
lastmodified=doc.LastModified
historystring=";["& author &", <"& lastmodified & ">];" & fieldcontent &";"
historycontent=historystring+historycontent
Call Source.FieldSetText(historyfield,historycontent)
Call Source.Refresh
Else
'Split content, get old value
firstsplit=Split(historycontent,">]")
erg_firstsplit=Cstr(firstsplit(1))
finalsplit=Split(erg_firstsplit,"[")
history_erg=Cstr(finalsplit(0))
'emliminate all blanks and new lines
history_erg_help=Cstr(Replace(history_erg,Chr$(13),""))
history_erg_help=Cstr(Replace(history_erg_help," ",""))
history_erg_help=Cstr(Replace(history_erg_help,";",""))
'count=Strcomp(history_erg_help,fieldcontent_help,0)
count=Strcomp(history_erg_help,fieldcontent_help,0)
If Strcomp(history_erg_help,fieldcontent_help,0)=0 Then
Else
Set nam=s.CreateName(s.UserName)
author=nam.Common
lastmodified=doc.LastModified
historystring=";["& author &", <"& lastmodified & ">];" & fieldcontent &";"
historycontent=historystring+historycontent
Call Source.FieldSetText(historyfield,historycontent)
Call Source.Refresh
End If
End If
Ich bin total ratlos