Hallo Forum,
ich programmiere eine Anbindung an den LN-Client 7.2. aus einer VB6-Anwendung heraus. Nun habe ich das Problem, das, wenn ich eine Email versenden möchte, nach dem .Send nichts passiert (die Mails also im Drafts-Ordner bleibt). Hier der entsprechende Code-Schnippsel:
'erstmal der ganze Initialiserungs-Kram
...
'Initialiserung fertig
Set lvobjNotesDoc = gvobjNotesDB.CreateDocument
lvobjNotesDoc.Form = "Memo"
lvobjNotesDoc.SendTo = "ich@testaccount.xy"
lvobjNotesDoc.Subject = "Test-Betreff"
Set lvobjRTItem = lvobjNotesDoc.CreateRichTextitem("Body")
call lvobjNotesDoc.Save(True, False)
Set lvobjNotesUIDoc = gvobjNotesWorkspace.EditDocument(False, lvobjNotesDoc)
call lvobjNotesUIDoc.GotoField("Body")
call lvobjNotesUIDoc.Import("Microsoft RTF", "c:\test.rtf")
call lvobjNotesUIDoc.GotoField("Subject")
call lvobjNotesUIDoc.Save
call lvobjNotesUIDoc.Document.ReplaceItemValue("ActionInProgress", "4194304")
call lvobjNotesUIDoc.Save
If pvblnSend then
'Das klappt irgendwie nicht :-(
call lvobjNotesUIDoc.Send
endif
call lvobjNotesUIDoc.Close(True)
'und hier alles wieder fein säuberlich aufräumen
...
'Aufräumen fertig
Zur Erläuterung: Wenn pvblnSend = False ist läuft alles einwandfrei. Ist der Wert allerdings True wird die .Send Zeile ausgeführt, im Client ist allerdings keine Veränderung festzustellen.
MfG
Thomas
P.S. Ich hoffe ich war nicht blind und habe eine gleiches / ähnliches Thema in der Suche übersehen ;-)
Hallo zusammen,
ich hab ein wenig gebastelt und bin einen Schritt weiter gekommen:
Ich habe die Stelle
call lvobjNotesUIDoc.Save
call lvobjNotesUIDoc.Document.ReplaceItemValue("ActionInProgress", "4194304")
call lvobjNotesUIDoc.Save
If pvblnSend then
'Das klappt irgendwie nicht :-(
call lvobjNotesUIDoc.Send
endif
call lvobjNotesUIDoc.Close(True)
in
call lvobjNotesUIDoc.Save
If pvblnSend then
call lvobjNotesUIDoc.Send
else
call lvobjNotesUIDoc.Document.ReplaceItemValue("ActionInProgress", "4194304")
call lvobjNotesUIDoc.Save
endif
call lvobjNotesUIDoc.Close(True)
umgebaut. Beim debuggen sah das auch alles so weit ok aus. Wenn ich das ganze allerdings normal laufen lasse bekomme ich in der .Send-Zeile eine Meldung im LN-Client, ob ich die Änderungen speichern möchte (aber das mache ich doch eine Zeile vorher??).
Grüße
Thomas
also ich hab das jetzt so:
call lvobjNotesUIDoc.Save
If pvblnSend then
call lvobjNotesUIDoc.Document.ReplaceItemValue("SaveOptions", "0")
call lvobjNotesUIDoc.Send
else
call lvobjNotesUIDoc.Document.ReplaceItemValue("ActionInProgress", "4194304")
call lvobjNotesUIDoc.Save
endif
call lvobjNotesUIDoc.Close(True)
und er läuft definitiv in den ersten Zweig mit dem .Send rein. Nehm ich die Zeile mit den SaveOptions raus kommt die Meldung, diese betsätige ich und das Ding landet im Send-Ordner.
Hab ich da jetzt ein Denkfehler? Hätte vllt. gestern doch nicht so lange das verlorene Finale betrauern sollen ;-)
Das gute alte TryAndError-Prinzip hat weiter geholfen >:D
Mit
call lvobjNotesUIDoc.Document.ReplaceItemValue("SaveOptions", "1")
klappt es jetzt wunderbar.
Danke nochmal an alle.