I have a PB application which calls Outlook to send messages. I want to trap and log errors if any. Here is my code:
ole_Item = ole_Outlook.CreateItem(0)
ole_Item.HTMLBody = ls_Body
= 'Test message from PowerBuilder'
= 'Some User<email@example.com>'
MessageBox('ole error', ex.Text)
I do not have permissions to send as that user so this should give me an error. But my code does not catch the exception. Instead I get the PB "Error calling external object function..." message. I also tried with oleRuntimeError but still the same result.
What am I doing wrong?