Domino 9 und frühere Versionen > ND6: Entwicklung
Mail aus Excel per VBA generieren - nicht sofort versenden
klaussal:
Mal so auf die Schnelle gedacht: das Mail nur als Vorlage erzeugen. Die kann dann später verschickt werden. Jetzt frag mich aber nicht, welche Felder welchen Inhalt haben müssen.... ;D
Glombi:
--- Zitat von: ZaLudtske am 09.05.06 - 08:20:18 ---Hallo,
leider ist mir ein Denkfehler unterlaufen die Frondend-Klassen (alles mit NotesUi...) kann nam über COM nicht ansprechen.
Es gäbe aber eine Umgehungslösung. Man könnte die Mail erzeugen und speichern. Die DocumentUniqueId in einem Benutzerprofile speichern und danach einen Agenten starten der an Hand der gespeicherten DocumentUniqueId die Mail öffnet.
Hat jemand eine bessere Idee? Mir fällt sonst keine Lösung auf die schnelle ein.
R.
--- Ende Zitat ---
UI-Klassen kann man nicht mit COM, aber mit OLE ansprechen.
Dazu gibts hier im Forum einige Threads
Aus der Hilfe:
The Notes client is an OLE automation controller and server.
Note This feature is not supported under OS/2, under UNIX, or on the Macintosh.
OLE automation controller
Notes is an OLE automation controller. You can use the LotusScript GetObject function to open an OLE automation object, and the CreateObject function to create an OLE automation object. You can also use the CreateObject and GetObject methods of the NotesUIDocument class.
OLE automation server
Notes registers itself as an OLE automation server and provides the following OLE automation objects:
Notes.NotesUIWorkspace provides access to the Domino UI objects.
Notes.NotesSession provides access to the Domino Objects (that is, the back-end objects).
External applications can create and reference the automation objects, then work down through the object hierarchies. For example, a Visual Basic application might contain the following code:
Set workspace = CreateObject("Notes.NotesUIWorkspace")
Set doc = workspace.CurrentDocument
Or:
Set session = CreateObject("Notes.NotesSession")
Messagebox session.UserName
A Notes client must be installed on the same machine as the Visual Basic program. Notes runs as a separate process when acting as an OLE automation server.
OLE automation uses late binding. You cannot create new Domino objects as you would in LotusScript. You must create (for example, with CreateObject) a Notes.NotesUIWorkspace or Notes.NotesSession object and work down through the hierarchies using the available methods. For example, if you want to open a Domino back-end database, create a Notes.NotesSession OLE automation object, and then use the GetDatabase method of NotesSession to set a reference variable.
In Visual Basic, declare the reference variables for all Domino objects as type Object. When you finish using a Domino object, set the reference variable to Nothing to free the memory it uses.
Use dot notation, just as in LotusScript, to access the properties and methods of an object.
alexbeer:
Hallo,
--- Zitat ---Deine Blauäugigkeit in Ehren, aber hier nicht zu prüfen ist sträflicher Leichtsinn
--- Ende Zitat ---
Über den Fall, dass Notes nicht geöffnet ist habe ich mir bislang wenig Gedanken gemacht - dann wird die Mail halt nicht verschickt, oder passiert noch etwas anderes?
Ich sehe aber jetzt schon, dass mein Vorhaben etwas komplizierter zu sein scheint.
Ich hatte gehofft, dass ich nur an einem Paramter drehen muss, so dass die Mail nicht versendet wird.
Leider scheint das nicht zu gehen. Bevor ich das große Workarounds einbaue, werde ich glaube ich auf eine zusätzliche Kontrollmöglichkeit des Nutzers vertrauen und die Mail gleich so rausschicken.
Sollte einem von euch trotzdem noch ein Gedanke einfallen, dann nehme ich den gerne auf.
Viele Grüße
Alex
Axel:
--- Zitat von: alexbeer am 09.05.06 - 13:41:41 ---Über den Fall, dass Notes nicht geöffnet ist habe ich mir bislang wenig Gedanken gemacht - dann wird die Mail halt nicht verschickt, oder passiert noch etwas anderes?
--- Ende Zitat ---
Das kommt auf deinen Code an. Mit Sicherheit wird der User eine, für ihn kryptische, Fehlermeldung erhalten. Das solltest du auf jeden Fall abfangen. Das erspart dir einiges an Telefonaten.
Axel
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln