Hi Tode,
richtig, so mache ich das. Ich öffne das Dokument über den webretriever, dann habe ich den Inhalt des RTFs als HTML und kann dann damit weiter arbeiten.
Hier mal einpaar Codeschnipsel:
[b]Funktionsaufruf:[/b]
.....
Dim tmpdoc As NotesDocument
Dim serverfinalname As String
Set uidoc= ws.editdocument(True,doc)
Call uidoc.Save
Call uidoc.Close(True)
'Aktuellen Servernamen holen um den HTML-Code zu holen
serverCommonName = serverName.Common
serverfinalname = GetIpAddress(serverCommonName)
finalhtml = contenthtml(s, "http://" & serverfinalname & dbname(0) &"id/" & doc.UniversalID)
'ENDE
If finalhtml = "fehler001" Or finalhtml="fehler002" Then
Goto Fehler
Else
Goto Weiterverarbeiten
End If
[b]Funktion GetIPAdress[/b]
Function GetIPAddress(theserver As String) As String
Dim s As New notessession
Dim pab As notesdatabase
Dim addbooks As Variant
Dim connections As notesview
Dim conDoc As notesdocument
Dim dc As NotesDocumentCollection
Dim count As Integer
Dim tmpback As String
Dim tmp As Variant
addbooks = s.addressbooks
Forall dbs In addbooks
If dbs.isprivateaddressbook Then
If Ucase(dbs.filename) = "NAMES.NSF" Then
Set pab = dbs
If Not pab.isopen Then Call pab.open("", "")
Exit Forall
End If
End If
End Forall
Set connections = pab.getview("($Connections)")
Set dc = connections.GetAllDocumentsByKey("*", True)
If dc.count = 0 Then
GetIpAddress = theserver
Else
Set conDoc = dc.GetFirstDocument
For count = 0 To dc.Count - 1
tmp = Evaluate({@Middle("} & conDoc.Destination(0)& {"; "="; "/")})
tmpback= tmp(0)
If Lcase(tmpback) = Lcase(theserver) Then
GetIpAddress = conDoc.OptionalNetworkAddress(0)
End If
Set conDoc = dc.GetNextDocument(conDoc)
Next
If GetIpAddress = "" Then
GetIpAddress = theserver
End If
End If
End Function
[b]Function ContentHTML:[/b]
Function contenthtml(s As NotesSession, theurl As String) As String
Dim webDb As NotesDatabase
Dim doc As NotesDocument
Dim mime As NotesMIMEEntity
Dim item As NotesItem
Dim url As String
Dim Text As String
Dim i As Integer
Set webDb = New NotesDatabase("","perweb.nsf")
url = theurl
s.ConvertMime = False
For i = 0 To 1 Step 4
Set doc = webDb.GetDocumentByURL(url + "?OpenDocument&date=" + Cstr(Rnd(0)), 1)
Next
If doc Is Nothing Then
Text = "fehler001"
Else
If Not doc.httpstatus(0) = "200" Then
Text = "fehler002"
Else
Set item = doc.GetFirstItem( "Body" )
Set mime = item.GetMimeEntity
Text = mime.ContentAsText
Text = Trim(Text)
End If
End If
s.ConvertMime = True
' In der Webmaske ist der Content der Seite zwischen den Tags "contentofpage" eingeschlossen. StrMiddle ist eine @Middle-Script-Umsetzung
contenthtml = strMiddle(Text, "<contentofpage>", "</contentofpage>")
End Function
Noch ein Screenshot anbei für die Webmaske. Und wichtig: Der Inhalt des RTF-Feldes in der Erfassungsmaske wird nicht als MIME gespeichert ;)
Hoffe du kannst mit dem Code was anfangen. Wenn ich irgendwo noch eine wichtige Funktion ausgelassen haben sollte, einfach bescheid geben. Viel Erfolg!