Domino 9 und frühere Versionen > ND6: Entwicklung
Rechtschreibprüfung - Lotus Skript
olma:
Hi,
dieses Skript liegt auf einer SENDEN Schaltfläche. Ich benötige eine zusätzliche Funktion in dem Skript, dass vor dem senden eine Rechtschreibprüfung auf das Dokument stattfindet.
Sub Click(Source As Button)
On Error Goto ErrorHandling
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim maildoc As NotesDocument
Dim item As NotesItem
Dim bodyRT As NotesRichtextItem, grussRT As NotesRichtextItem
Dim UNIDFeld As Variant
Dim MailAdrFeld As Variant
Dim zieldoc As NotesDocument
Dim mainkonfdoc As NotesDocument
Dim neudoc As NotesDocument
Dim k As Integer
Dim resDB As NotesDatabase
Dim resdoc As NotesDocument
Dim em As String
Dim EMess As String
Set uidoc = workspace.CurrentDocument
Set db = session.CurrentDatabase
If GetKonfigDB ( "", "profilServer", "profilFile", resDB, EMess ) = False Then Error 15010, EMess
If HoleRessourcenDoc ( GetAbbreviateUserName ( Session.UserName ), resDB, resdoc , EMess ) = False Then Error 15010, EMess
Set mainkonfdoc = GetConfigDoc("MAIN")
If mainkonfdoc Is Nothing Then
Msgbox "No main configuration available ?!?"
Exit Sub
End If
Call uidoc.FieldSetText( "MailStatus", "2" )
Call uidoc.FieldSetText("DokStatus", "3")
Call uidoc.save
Set doc = uidoc.Document
Set maildoc = db.CreateDocument
maildoc.Subject = doc.Subject(0)
Set item = doc.GetfirstItem("Body")
Call item.CopyItemToDocument(maildoc, "")
maildoc.from = doc.From(0)
maildoc.SendTo = doc.SendTo
maildoc.CopyTo = Evaluate("CopyTo : AKMCopyTo", doc)
maildoc.BlindCopyTo = doc.BlindCopyTo
maildoc.DeliveryPriority = doc.DeliveryPriority
maildoc.ReturnReceipt = doc.ReturnReceipt
maildoc.DeliveryReport = doc.DeliveryReport
Call maildoc.send(False)
Messagebox " Mail was sent! ", MB_IconInformation, "Mail dispatching"
Print("Mail transferred for delivery")
UNIDFeld = doc.AKMRef
MailAdrFeld = doc.AKMCopyTo
anz = Ubound(UNIDFeld) 'fängt bei Null an!!
If anz = 0 Then
If UNIDFeld(0) = "" Then Exit Sub
End If
Print("Create mail references")
For k = 0 To anz
Set zieldoc = db.GetDocumentByUNID(UNIDFeld(k))
If zieldoc Is Nothing Then
Messagebox "The mail reference could not be created:" + Chr$(10) + MailAdrFeld(k)
Else
If ErzeugeMailReferenz ( db, resdoc, zieldoc, doc, 2, mainkonfdoc.f_MailReferenzen ( 0 ), neudoc, mainkonfdoc, EMess ) = False Then Error 15010, EMess
If neudoc.Save( True, False, True ) = False Then Error 1010, "The mail reference for document " & Cstr ( zieldoc.UniversalID ) & Chr ( 10 ) & _
"could not be saved in AKM !"
End If
Next
Print("Mail references created")
Exit Sub
ErrorHandling:
ErrorNr = Err
Select Case ErrorNr
Case 4091
Set zieldoc = Nothing
Resume Next
Case Else
End Select
Messagebox Error$ & "(" & Cstr(ErrorNr) & ") [Zeile " & Cstr ( Erl ) & "]", 16, "Error:"
Exit Sub
End Sub
In der Designer Hilfe habe ich nur eine Funktion gefunden (@Command( [ToolsSpellCheck] )) die mir aber in diesem Fall nicht nuzt.
Kann mir jemand das Skript ergänzen?
Gruss
Olli
Driri:
Laut Designer-Hilfe :
Syntax
Call notesUIDocument.SpellCheck()
Usage
The UI document must be in Edit mode before this method is called.
olma:
erstmal danke, kannst du mir bitte sagen wo ich dein Skript einfügen muß? ich kann leider kein Lotus Skript ??? noch net ;)
koehlerbv:
Genau soetwas habe ich befürchtet: Ein fragliches Ansinnen (ich kann kein LotusScript, aber ich möchte ...) und dann kommt prompt die falsche Antwort, und der Fragestellende hat keinen Peil, warum das Gefrickelte nun nicht funktioniert.
Direkt vom dem maildoc.Send sind die Messen für die Rechtschreibprüfung längst gelesen.
Bernhard
Driri:
Ich schließe mich Bernhard an, wenn man sich mit Script nicht wenigstens ein bißchen auskennt, ist das nicht die richtige Aufgabe.
Ich helfe zwar gerne, aber ich befürchte, daß Dir das nicht viel bringen wird, denn beim nächsten Problem stehst Du wie der Ochs vorm Berg und weißt nicht weiter.
Wenn man sich an Scripte heranwagt, dann sollte man sich auf jeden Fall vorher intensiv mit dem Thema beschäftigt haben. Man kann nicht alles wissen, aber ein Grundverständnis ist absolutes Minimum.
Aber um Dir weiterzuhelfen, probier folgendes aus. Pack den Code vor das "Call uidoc.Save".
Dann wird vorm Speichern des aktuellen Dokuments der Spellcheck gestartet und wenn der User damit fertig ist, wird gespeichert und das Script läuft weiter ab.
Wichtig ist dabei, daß das UIDoc im Bearbeitenmodus sein muß. Das mußt Du auf jeden Fall sicherstellen.
Navigation
[0] Themen-Index
[#] Nächste Seite
Zur normalen Ansicht wechseln