Michael Drechsel
[WD22] Start Outlook and hold it open June 07, 2018 03:54PM |
Arie
Re: [WD22] Start Outlook and hold it open June 07, 2018 04:36PM |
PROCEDURE EmailSendMessageOutlookDotNet(LOCAL arrRecipients is array of string, LOCAL sSubject is string, sMessage is string, LOCAL arrAttachements is array of string) bResult is boolean myItem is object OLE dynamic myOlApp is object OLE dynamic myOlAccount is object OLE dynamic myOlAccounts is object OLE dynamic anAttachement is EmailAttach sRecipient is string sAttachement is string nOutlookAccount is int WHEN EXCEPTION IN myOlApp = new object OLE "Outlook.Application" myOlAccounts = myOlApp>>Session>>Accounts FOR i = 1 TO myOlApp>>Session>>Accounts>>Count //IF Lower(sOutlookAccount) = Lower(myOlApp>>Session>>Accounts>>Item(i)>>DisplayName) THEN nOutlookAccount = i BREAK //END END IF nOutlookAccount <= 0 THEN RESULT False END myOlAccount = myOlAccounts>>item(nOutlookAccount) // Trace(myOlAccount>>displayname) myItem = myOlApp>>CreateItem(olMailItem) FOR EACH sRecipient OF arrRecipients myItem>>Recipients>>Add(NoSpace(sRecipient)) END FOR EACH sAttachement OF arrAttachements IF fFileExist(CompleteDir(fTempPath()) + sAttachement) THEN myItem>>Attachments>>Add(CompleteDir(fTempPath()) + sAttachement) ELSE IF fFileExist(sAttachement) THEN myItem>>Attachments>>Add(sAttachement) END END END myItem>>BodyFormat = 2 // html // First display the email to get the users signature myItem>>Display() // then add the body/message myItem>>Subject = sSubject myItem>>HTMLBody = RTFToText(sMessage) + CR + myItem>>HTMLBody myItem>>SendUsingAccount(myOlAccount) IF myOlApp>>ActiveWindow <> Null THEN myOlApp>>ActiveWindow>>Activate END // Now send the email //myItem>>Send() bResult = True DO LogInfo(dbgInfo(dbgProcess),ExceptionInfo(errCode),ExceptionInfo(errMessage),TYPE_ERROR,NOT m_bSilent) END RESULT bResult
Fabrice Harari
Re: [WD22] Start Outlook and hold it open June 07, 2018 04:53PM |
Frans
Re: [WD22] Start Outlook and hold it open June 20, 2018 09:55AM |
Arie
Re: [WD22] Start Outlook and hold it open June 20, 2018 10:07AM |
Frans
Re: [WD22] Start Outlook and hold it open June 20, 2018 10:28AM |
Frans
Re: [WD22] Start Outlook and hold it open June 20, 2018 01:55PM |
Aad Gouka
Re: [WD22] Start Outlook and hold it open June 20, 2018 02:18PM |
Frans
Re: [WD22] Start Outlook and hold it open June 20, 2018 02:26PM |