1. Kari Paukku
  2. PowerBuilder
  3. Tuesday, 14 February 2023 03:40 AM UTC

Hi,

I have a requirement to view (nothing else) Outlook messages in the application.

The msg file is stored in the database as a blob and I can open the message in Outlook - all that is fine.

But now the requirement is to view the message in the application, not in Outlook.

Would anyone have an example of how this is done (using PB 2021)?

 

Thanks,
Kari

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 14 February 2023 03:49 AM UTC
  2. PowerBuilder
  3. # 1

Hi Kari;

   If you & your users are using Outlook, then you should see when creating a visual OLE object an "Outlook Viewer" object class registered in your O/S. If so, you could try adding that OLE Class to your App & then try to have it display .msg files.

Food for thought.  HTH 

Regards... Chris 

 

Comment
  1. Kari Paukku
  2. Tuesday, 14 February 2023 04:02 AM UTC
Chris,

Thanks, did find the control and added it ok to my test application.

Now the next question is, how do I tell the control what file to load?

I tried to search the web for an answer, but no luck.



Kari
  1. Helpful
There are no comments made yet.
Kari Paukku Accepted Answer Pending Moderation
  1. Tuesday, 14 February 2023 04:07 AM UTC
  2. PowerBuilder
  3. # 2

I just remembered the PB OLE Browser but couldn't find anything there that would shout "use me".

 Something simple like ole_1.object.ShowMessage(<path to message file>)...

 

 

 

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 14 February 2023 04:51 AM UTC
  2. PowerBuilder
  3. # 3

hI,

If you use the object browser painter, you can go to the OLE tab and look up your Outlook Viewer. There's a function called 'Open()', maybe that one will serve you needs. 

 

Comment
  1. Kari Paukku
  2. Tuesday, 14 February 2023 05:22 AM UTC
Adding the control connects ok to Outlook and displays all messages in the inbox. The Open(() does show the selected email in Outlook.

My thing is that the message I want to view is in the database as a blob from where I read it to a ,msg file. It is that file I would like to view. The open doesn't take any parameters



I'll keep searching....
  1. Helpful 1
  1. Miguel Leeuwe
  2. Tuesday, 14 February 2023 05:42 AM UTC
Yes, you have to write the blob to a file on disk in for example the users temp folder of windows. After that you can pass it in to the Open() function. When finished viewing you deleted the MSG file from the temp folder.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 14 February 2023 13:02 PM UTC
Hi Kari;

You'll need to use the SelectBlob command to get the .msg data from your DB & then the FileWritex command to write the data into an external file. Then you can point the Outlook OLE control to that file that you just wrote.

Regards ... Chris
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.