Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: adminnaddel am 22.01.03 - 08:56:12
-
Hallo liebe Gemeinde,
ich habe eine Webdb, welche über eine Eingabemöglichkeit in einem Richtextfeld verfügt. Nun möchte ich die Form schließen iund speichern. Dabei soll der Inhalt aus dem Richtextfeld in ein normales Feld übergeben werden.
Probiert habe ich es mit:
@If(@IsDocBeingSaved;Feld2;Feld1)
Diese Möglichkeit greift aber bei einem Richtextfeld nicht und ich weiß auch nicht unbedingt ob diese Art der Übergabe in einer Webdb greifen würde.
Einen kurzen Tipp für mich, bitte! ::)
Grüsse
-
also....
probiert habe ich es so:
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim itemA As NotesItem
Set db = session.CurrentDatabase
Set itemA = doc.GetFirstItem( "Body" )
If ( itemA Is Nothing ) Then
Messagebox( "No Subject item on the document." )
Else
Call itemA.copyitemToDocument( doc, "Inhalt" )
End If
End Sub
Kriege aber bei:
Set itemA = doc.GetFirstItem( "Body" ) leider die Meldung=
Variable not set
Ein bisschen Hilfe bitte :'(
Grüsse
-
hallo admin,
dazu gibt es gerade in Bezug zur getfirstitem Methode einen Hinweis zu RichText Items, die ja in Notes anders behandelt werden, als normale Items wie Text:
Using this method to get rich text items
The compiler raises an error if you try to set the return value of GetFirstItem equal to a NotesRichTextItem object. This is because a NotesItem is not necessarily a NotesRichTextItem, and the compiler has no way of knowing whether the name$ you specify actually corresponds to a rich text item. For example:
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
'...set value of doc...
Set rtitem = doc.GetFirstItem( "Body" )
'compiler complains
The solution to this problem is to declare a variant, set it equal to the return value of GetFirstItem, and then treat the variant as a NotesRichTextItem. For example:
Dim doc As NotesDocument
Dim rtitem As Variant
'...set value of doc...
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
'...use NotesRichTextItem methods...
End If