Domino 9 und frühere Versionen > Entwicklung

Cursor soll zum Body per "Call uidocMail.GotoField("Body")" hüpfen

(1/6) > >>

TMC:
Hi,

mit einem Script erstelle ich aus einer DB ein neues Mail
(Code in etwa: http://www.atnotes.de/index.php?board=7;action=display;threadid=11558)

Nun soll zum Schluß mit
Call uidocMail.GotoField("Body")  
der Cursor zum Bodyfeld hüpfen, aber klappt leider nicht.

Ins Subject-Feld mit
Call uidocMail.GotoField("Subject")  
klappt aber.

Wie kann ich denn in das RTFeld 'Body' den Cursor setzen?

TMC

ata:
... Richtextfelder sind erst vorhanden, wenn das Doc zum ersten Mal gespeichert wurde - würde ich mal raten...

ata

eknori:
si senor, das ist die Lösung.

koehlerbv:
Das dürfte das alte leidige Problem sein: Im Frontend hast Du ein RTF erst unter Kontrolle, wenn das Dokument im backend gespeichert und im Frontend erneut geöffnet wurde ...

Bernhard

TMC:
Hi Ata,

sorry, hätte doch den ganzen Code posten sollen, hier ist er:


--- Code: ---Sub Click(Source As Button)
   Dim session As New NotesSession
   Dim ws As New NotesUIWorkspace
   Dim uidoc As NotesUIDocument  
   Dim dbMail As NotesDatabase
   Dim docMail As NotesDocument
   Dim uidocMail As NotesUIDocument
   Dim profil As NotesDocument
   Dim docThis As NotesDocument
   Dim rti As NotesRichTextItem
   
   Set uidoc = ws.CurrentDocument 'ui
   Set docThis = uidoc.Document 'ui
   
'Prüfen ob Mail-DB vorhanden
   Set dbMail = New NotesDatabase("","")
   Call dbMail.OpenMail
   If Not dbMail.IsOpen Then
      Messagebox "Mail-Datenbank kann nicht geöffnet werden." + Chr$(10) + "Es wird kein Mail erstellt.", 16, "Fehler"
      Exit Sub
   End If  'If Not dbMail.IsOpen Then
   
'Mail erstellen   
   CreateMailMemo = 0
   Set profil = dbMail.GetProfileDocument("CalendarProfile")
   Set docMail = New NotesDocument(dbMail) 'neues Mail
   docMail.Form = "Memo" 'nimm Memo
   docMail.Logo = profil.DefaultLogo(0) 'Dient dazu, das Mail-Logo zu übernehmen
   docMail.Principal = profil.Owner(0) 'Dient dazu, das Mail-Logo zu übernehmen
   
'Mail-Felder füllen
   docMail.SendTo = docThis.a_test2 'Mailempfänger
   docMail.Subject = "Link: #" + docThis.a_ID(0) + " ( " + docThis.a_Area(0) + ")" 'Subject
   
'Anlegen und füllen des Richtextfeldes
   Set rti = docMail.CreateRichTextItem("Body" )
   Call rti.AddNewLine(3)
   Call rti.AppendText("Doc-Link >")
   Call rti.AppendDocLink(docThis, "") 'Doklink einfügen
   Call rti.AppendText("<")
   Call rti.AddNewLine(1)
   
'Temp-Speichern Backend-Doc, Öffnen Frontend-Doc, zum Schluß Löschen Backend-Doc (damit RTF-Feld angezeigt wird)
   Call docMail.Save(True,False)
   Set uidocMail = ws.EditDocument(True, docMail)
   Call docMail.Remove(True)
   
'Gehe zum Feld Body   
   Call uidocMail.GotoField("Body")  
End Sub
--- Ende Code ---

Body ist also eigentlich doch dann vorhanden....

TMC

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln