OIPI MAPI Error 0x4005 (OpenInsight 32-bit)
At 01 FEB 2022 02:18:29PM Bruce Cameron wrote:
Hello,
Running into a MAPI 0x4005 error when user uses the attaché button and Email option from OIPI window on OI 9.x
and talking to Office 2016 64-bit.
Is this a known incompatibility and/or any ideas to patch?
(Appears other methods (outside of OIPI) work fine.)
Thanks.
At 01 FEB 2022 02:46PM Jared Bratu wrote:
Bruce,
I've seen this error before too and believe it was related to Office 64-bit as well. I believe that going back to Office 32-bit will work.
However, I can offer this code snippet which uses PowerShell to create a new email message with an attachment in Outlook. The script was designed to send messages simple messages and might require modifications to send longer messages with HTML content since the script is passed into PowerShell as a command-line argument.
S = "" S<-1> = '$ol = New-Object -comObject Outlook.Application ; $mail = $ol.CreateItem(0)' If Attachment = '' Then S<-1> = '$mail.Subject = "{{SUBJECT}}" ; $mail.Body = "{{BODY}}" ; $Mail.To = ("{{Emailto}}") ; $mail.save()' End else S<-1> = '$mail.Subject = "{{SUBJECT}}" ; $mail.Body = "{{BODY}}" ; $Mail.Attachments.Add("{{ATTACHMENT}}"); $Mail.To = ("{{Emailto}}") ; $mail.save()' end S<-1> = '$inspector = $mail.GetInspector ; $inspector.Display()' Swap @FM With ";" In S Swap '"' With "'" In S Swap '{{SUBJECT}}' With Subject In S Swap '{{BODY}}' With Body In S Swap '{{ATTACHMENT}}' With Attachment In S Swap '{{Emailto}}' With Emailto In S pseargs = '-c "' : S : '"' pseWorkingDir ='' pseprogram = 'powershell.exe' Gosub privShellExecute Return privShellExecute: Declare Function RTI_WINAPI_ShellExecuteEx, Get_Property hwnd=get_Property( @window, "HANDLE" ) lpOperation="open" : \00\ lpFile=pseprogram : \00\ lpParameters=pseargs:\00\ lpDirectory=pseWorkingDir : \00\ nShowCmd=0 privShellExecute=RTI_WINAPI_ShellExecuteEx( hwnd, lpOperation, lpFile, lpParameters, lpDirectory, nShowCmd ) Return
At 02 FEB 2022 12:04PM Bruce Cameron wrote:
Hi Jared,
Thanks for the code snippet.
How would one integrate that with the OIPI function that processes emails and attachments through OIPI?
Bruce
At 02 FEB 2022 10:13PM cmeyer wrote:
Just to let you know that the email option with OIPI is depreciated in OI10, that is no longer available. I suggestyou find an alternative to using the emailing option before migrating to OI10.
I have suggested to Revelation and have a user defined button on OIPI export whose function is controlled by a config file. Then developers can use custom routines to send emails (or any other function) from the OIPI export function.
Chris.
At 03 FEB 2022 10:15AM Jared Bratu wrote:
Bruce,
Unfortunately, it doesn't integrate with OIPI. The solution only works if you can trigger the email with an attachment from your code - not OIPI.