Sending Email (with images) using MS Outlook and an ActiveX custom RichTextEdit

  • Miguel Leeuwe
  • Miguel Leeuwe's Avatar Code Author
  • Away
More
5 years 3 weeks ago - 1 year 10 months ago #265 by Miguel Leeuwe
Miguel Leeuwe created the code: Sending Email (with images) using MS Outlook and an ActiveX custom RichTextEdit
Sending Email (with images) using MS Outlook and an ActiveX custom RichTextEdit

See community.appeon.com/index.php/qna/q-a/o...x/oldest#filter-sort
or if no longer available, see the here attached PDF.

NOTES:
There's an MSI of a C# "richer text control", that you have to install for this to work. It's an attempt to deal better with pasted images, but it's far from perfect. Appeon has improved the way pasted images work in PB2022 (R2?), but I still have to test that. The visual studio solution that I used for this has disappeared from by GitLab account, so please ignore that information on the PDF. I do still have the VS solutions on my laptop if anyone's interested.

Myself I'm not using this in our applications. I'm just going with the RTE control that comes with Powerbuilder.
The code is still useful for knowing how to work with OLE and outlook instead of MAPI. It shouldn't be too hard to do the changes needed to make things work with a normal RTE, instead of the ActiveX. (maybe I'll do that when I have time or if someone really needs it).
In the u_email object, there an instance variable is_mailSystem. It can be set to:
'OUTLOOK' or 'OUTLOOK64' :
- 'OUTLOOK' uses MAPI for the Address book, but needs office 32 bit if your EXE is 32 bit. (and office 64 bit if your exe is 64 bit).
- 'OUTLOOK64' uses OLE for the Address book and has the advantage that the Address book will work regardless of your Office bitness. Hower, when clicking on the TO button, you'll see how the Outlook icon is flashing in the Taskbar, so the user has to click on that to bring the Address book to the front. ('OUTLOOK64' also works for 32bit)

When setting the instance variable is_ MAPI is only used for showing the Address Book, as it comes to the front.

EDIT: I've added a PB2019R3 version. (the first zip has a 12.6 and 2017 version).
I recommend reading the attached PDF, there might be more information.

This message has attachments files.
Please log in or register to see it.

Last Edit: 1 year 10 months ago by Miguel Leeuwe. Reason: Added some info

Please Log in or Create an account to join the conversation.

Moderators: Appeon Administrator