Using NotesUiDocument with c#

Hi, Anybody has a sample on how to use the NotesUiDocument and other UI classes in the lotus COM API with c#?

Thanks.

Subject: using NotesUiDocument with c#

You don’t. The UI classes need to use the older OLE classes (which to my knowledge means late binding) based on the Notes Automation Classes (Notes.NotesUIWorkspace, Notes.NotesSession rather than the Lotus.Whatever namespace).

Subject: RE: using NotesUiDocument with c#

Thanks for the reply.

I’m using the classes Domino.NotesSession,Domino.NotesDatabase,Domino.NotesDocument to create and send mails from c#. All the creation of the styles and the message is built in to the c# code.

It would be nice if there is an option of launching the notes client with the constructed message so the users can preview and make corrections before send.

Or a facility to import a word document into the NotesDocument object where the richtextstyle is automtically generated.

Sorry if I sound ignorant.

Subject: RE: using NotesUiDocument with c#

Again, you need to use the Notes (not Domino) classes, which imply late binding. Or you can drop to unmanaged code and use the C API.

Subject: RE: using NotesUiDocument with c#

How do I get a reference to this assembly in my .NET project? I do not see anything under COM other than interop.lotus and interop.domino.

Is this available as a toolkit for download?

Thanks!!

Subject: RE: using NotesUiDocument with c#

You don’t – it’s late-bound. Everything is just Object until run-time, which is the first chance you get to make type determinations.

Subject: RE: using NotesUiDocument with c#

I was able to do the import but unfortunately I want to do some more stuff after import.

            Type NotesUIWorkspaceType = Type.GetTypeFromProgID("Notes.NotesUIWorkspace");





            object workspace = Activator.CreateInstance(NotesUIWorkspaceType);



   

	object[] argsMail = { serverName, databaseFileName, "Memo" };



            object uiDoc = NotesUIWorkspaceType.InvokeMember("ComposeDocument", BindingFlags.InvokeMethod, null, workspace, argsMail);











            object[] Arguments = {

                            (System.Object) "Microsoft Word", 

                            (System.Object) @"c:\test.doc", 

                            };



            object doc = NotesUIWorkspaceType.InvokeMember("Import", BindingFlags.InvokeMethod, null, uiDoc, Arguments);









            object notesDocument = NotesUIWorkspaceType.InvokeMember("Document", BindingFlags.GetProperty, null, uiDoc, null);

// At this point, I would like to get a NotesDocument object so I can attach files to the already imported content.

// How to create a NotesDocument object from this com object?

Thanks so much for any help!!