- Ashutosh Varshney
- PowerBuilder
- Friday, 15 November 2019 04:38 PM UTC
Hello everyone.
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
ole_Item.Subject
= 'Test message from PowerBuilder'
ole_Item.To
= ls_To
ole_Item.SentOnBehalfOfName
= 'Some User<someone@somewhere.com>'
Try
ole_Item.Send()
Catch(RuntimeError
ex)
MessageBox('ole error', ex.Text)
End
Try
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?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.