Print a Lotus notes Document with C# DLL

0

I created a dll in C # that takes as a parameter the name of the Lotus

Domino server, the name of the data base lotus notes and the UNID of a document of this base.The goal of this dll is to open in read mode the document having the UNID passed as parameter and then print the document via the printer installed on the machine. the problem is that sometimes the DLL instead of open the Document notes, it opens the attachment attached in this document and generates the following exception:

COMException.Message = L'objet invoqué s'est déconnecté de ses clients. (Exception de HRESULT : 0x80010108 (RPC_E_DISCONNECTED))
COMException.ErrorCode = -2147417848
COMException.ToString = System.Runtime.InteropServices.COMException (0x80010108): L'objet invoqu‚ s'est d‚connect‚ de ses clients. (Exception de HRESULT : 0x80010108 (RPC_E_DISCONNECTED))
   … System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   … System.Dynamic.ComRuntimeHelpers.GetITypeInfoFromIDispatch(IDispatch dispatch, Boolean throwIfMissingExpectedTypeInfo)
   … System.Dynamic.IDispatchComObject.EnsureScanDefinedMethods()
   … CallSite.Target(Closure , CallSite , ComObject , Int32 , Int32 , Int32 , Boolean )
   … CallSite.Target(Closure , CallSite , Object , Int32 , Int32 , Int32 , Boolean )
   … PrintNotesUIDocumentCOM_version_14_12_2015.PrintNotesDocument_version_14_12_2015.PrintFaxDocument_version_14_12_2015(String serverName, String baseName, String UNID)
COMException.Data = System.Collections.ListDictionaryInternal
c#
dll
printing
lotus-notes
asked on Stack Overflow Jan 29, 2016 by habiba kessraoui • edited Jan 29, 2016 by Andro

1 Answer

0

It is very likely that document's form has the form property "Auto Launch" set to "-First OLE Object-" or "-First Attachment-".
Set it to "-None-".

If it is already "-None-" then have a look at QueryOpen() and PostOpen() events of form and subforms. There might be code for attachment execution.

answered on Stack Overflow Jan 29, 2016 by Knut Herrmann • edited Jan 30, 2016 by Knut Herrmann

User contributions licensed under CC BY-SA 3.0