Lotus notes save method RPC_E_DISCONNECTED

0

I have a issue with the saving lotus notes document:

ERROR: Internal : Could not execute code stage because exception thrown by code stage: System.Runtime.InteropServices.COMException (0x80010108): The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED)) at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn) at Lotus_Mail.vytvor_mail_na_serveru(String sendTo, String sendFrom, String subject, String bodyText, DataTable attachments, String& stav)

Probably line MailDoc.save throws the exception.

    Dim sess As Object = CreateObject("Notes.NotesSession")

    Dim MailDoc As Object
    Dim AttachME As Object
    Dim EmbedObj As Object
    Dim db As Object

    Dim Principle As String = sendFrom

    Try
        'sess = CreateObject("Lotus.NotesSession")
        'Call sess.Initialize()

        db = sess.getDatabase("xxx", "mail1.box")

        If db Is Nothing Then
            db = sess.getDatabase("xxx", "mail2.box")
        End If

        MailDoc = db.CreateDocument
        MailDoc.REPLACEITEMVALUE("Form", "Memo")
        MailDoc.REPLACEITEMVALUE("Principal", Principle & "@abc.cz")
        MailDoc.REPLACEITEMVALUE("From", Principle)
        MailDoc.REPLACEITEMVALUE("SendFrom", Principle)
        MailDoc.REPLACEITEMVALUE("Sender", Principle)

        MailDoc.REPLACEITEMVALUE("SendTo", sendTo)
        MailDoc.REPLACEITEMVALUE("Recipients", sendTo)
        MailDoc.REPLACEITEMVALUE("Subject", subject)

        MailDoc.REPLACEITEMVALUE("PostedDate", Now().AddSeconds(5))

        stav = "dokument vytvoren"

        If attachments.Rows.Count > 0 Then

            AttachME = MailDoc.CREATERICHTEXTITEM("Body")
            AttachME.appendText(bodyText & Environment.NewLine)

            For Each dataR as DataRow in attachments.Rows

                EmbedObj = AttachME.EMBEDOBJECT(1454, "", dataR("attachmentPath"), dataR("attachmentName"))

                Thread.Sleep(1000)

                EmbedObj = Nothing

                Thread.Sleep(1000)

            Next dataR

        End If

        MailDoc.Save(True, True, True)

An suggestion?

vb.net
asked on Stack Overflow Mar 26, 2020 by David Svačina • edited Mar 26, 2020 by BigBen

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0