0

im trying to create the object NotesUIWorkspace to open the Maildialog from an Lotus Note Client V9 (add attachmen, text, recipents, ec) but it doesn't work I'm searching for the reference for NotesUIWorkspace, (i don't find it)

dim obj as Object
obj = CreateObject("Notes.NotesUIWorkspace") 

The Class i'm Trying to use https://notes.helsinki.fi/help/help8_designer.nsf/2e73cbb2141acefa85256b8700688cea/027a2bc771e3cb6e8525731b004a77f6?OpenDocument#183993280029220079
from the Documentation https://notes.helsinki.fi/help/help8_designer.nsf/Main?OpenFrameSet

I have searched for some examples but i didn't find any usefull for my expirience level.
Does anybody have some usefull tipps or examples?

Best Regards Florian

CaptFlo
  • 3
  • 4
  • You do understand that the Notes Automation Classes (OLE API) has been deprecated since Notes R5.0.2c (14+ years ago), right? – Stan Rogers Jul 23 '14 at 06:47
  • I think that only applies to the back-end classes in the OLE automation library (Notes.NotesSession), which were replaced by the COM version (Lotus.NotesSession). The front-end (Notes.NotesUIWorkspace) has continued to be fully supported as far as I know. – Richard Schwartz Jul 23 '14 at 18:58

2 Answers2

1

Here is an example using C# that will compose a memo in the UI:

public void ComposeMemo(String sendto, String subject, String body)
        {
            // instantiate a Notes session and workspace
            Type NotesSession = Type.GetTypeFromProgID("Notes.NotesSession");
            Type NotesUIWorkspace = Type.GetTypeFromProgID("Notes.NotesUIWorkspace");
            Object sess = Activator.CreateInstance(NotesSession);
            Object ws = Activator.CreateInstance(NotesUIWorkspace);

            // open current user's mail file
            String mailServer = (String)NotesSession.InvokeMember("GetEnvironmentString", BindingFlags.InvokeMethod, null, sess, new Object[] { "MailServer", true });
            String mailFile = (String)NotesSession.InvokeMember("GetEnvironmentString", BindingFlags.InvokeMethod, null, sess, new Object[] { "MailFile", true });
            NotesUIWorkspace.InvokeMember("OpenDatabase", BindingFlags.InvokeMethod, null, ws, new Object[] { mailServer, mailFile });
            Object uidb = NotesUIWorkspace.InvokeMember("GetCurrentDatabase", BindingFlags.InvokeMethod, null, ws, null);
            Object db = NotesUIWorkspace.InvokeMember("Database", BindingFlags.GetProperty, null, uidb, null);
            Type NotesDatabase = db.GetType();

            // compose a new memo
            Object uidoc = NotesUIWorkspace.InvokeMember("ComposeDocument", BindingFlags.InvokeMethod, null, ws, new Object[] { mailServer, mailFile, "Memo", 0, 0, true });
            Type NotesUIDocument = uidoc.GetType();
            NotesUIDocument.InvokeMember("FieldSetText", BindingFlags.InvokeMethod, null, uidoc, new Object[] { "EnterSendTo", sendto });
            NotesUIDocument.InvokeMember("FieldSetText", BindingFlags.InvokeMethod, null, uidoc, new Object[] { "Subject", subject });
            NotesUIDocument.InvokeMember("FieldSetText", BindingFlags.InvokeMethod, null, uidoc, new Object[] { "Body", body });

            // bring the Notes window to the front
            String windowTitle = (String)NotesUIDocument.InvokeMember("WindowTitle", BindingFlags.GetProperty, null, uidoc, null);
            Interaction.AppActivate(windowTitle);
        }
Ken Pespisa
  • 21,989
  • 3
  • 55
  • 63
  • Ist it posible tu use this class in .net – CaptFlo Jul 22 '14 at 14:20
  • Is it possible to add html and Attachments, or how to i get to know wich targets i have to edit? – CaptFlo Jul 22 '14 at 15:03
  • i found this site http://www.experts-exchange.com/Programming/Languages/.NET/Q_24938382.html but i can't find any solutions for attachments and html – CaptFlo Jul 22 '14 at 15:28
  • Please don't ask follow-up questions in comments. If Ken's answer works for you to get you past the problem with creating the issue you asked about re NotesUIWorkspace, then mark it as accepted, try the next steps of your task yourself, and if you have a new question then by all means open a new question here. – Richard Schwartz Jul 22 '14 at 20:19
  • It Looks like there is no very usable Information for that, but your's worked. – CaptFlo Jul 23 '14 at 07:02
0

Are you running on a 64 bit OS? If so, you can expect to have some problems with the Domino classes. They are not supported for 64 bits though they can be made to work, mostly.

See my answer to this question for some links to additional information.

Community
  • 1
  • 1
Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41