G
googlegroup
I know this is a VBA group and this is a powerbuilder question BUT I
noticed that the author of the Redemption code answers post here so I
thought I would try and post my question here
I have a PB application where I would like to show the address book
and let the users select the email addresses for the message being
sent.
I have the following code and this works as long as the user selects
the OK button from the address book dialog. Then everything works
like a charm BUT if the user selects Cancel from the address book
dialog you get a PB error message
Error calling external object function showaddressbook
I am using the newest version of Redemption and I am using the
RDOSession because I need to use the SaveAs function to save the
created email as a .msg file and found using the SaveMailitem that
this did not work. It would only save an empty email .msg file
unless
I used oleSafeMailItem.Item.SaveAs(filename,3) AND then you get the
dreaded Outlook Security message popup.
Session = Create OLEObject
li_Return = Session .ConnectToNewObject( "Redemption.RDOSession" )
Session .Logon
Msg = Session .GetDefaultFolder(4).Items.Add(0)
Msg.Recipients.Add ("(e-mail address removed)" )
Msg.Recipients.ResolveAll
Msg.Subject = "Hello"
Msg.Body = "Testing Applications"
ab = Session .AddressBook
recips = AB.ShowAddressBook(Msg.Recipients) /* This is the line that
the error message is for BUT this does actually show the addressbook
but if the user clicks cancel this line then reports the error and
dies. I have debugged it and it is dying on this line.
Msg.Recipients = Recips
Any help would be greatly appreciated.
Thanks
noticed that the author of the Redemption code answers post here so I
thought I would try and post my question here
I have a PB application where I would like to show the address book
and let the users select the email addresses for the message being
sent.
I have the following code and this works as long as the user selects
the OK button from the address book dialog. Then everything works
like a charm BUT if the user selects Cancel from the address book
dialog you get a PB error message
Error calling external object function showaddressbook
I am using the newest version of Redemption and I am using the
RDOSession because I need to use the SaveAs function to save the
created email as a .msg file and found using the SaveMailitem that
this did not work. It would only save an empty email .msg file
unless
I used oleSafeMailItem.Item.SaveAs(filename,3) AND then you get the
dreaded Outlook Security message popup.
Session = Create OLEObject
li_Return = Session .ConnectToNewObject( "Redemption.RDOSession" )
Session .Logon
Msg = Session .GetDefaultFolder(4).Items.Add(0)
Msg.Recipients.Add ("(e-mail address removed)" )
Msg.Recipients.ResolveAll
Msg.Subject = "Hello"
Msg.Body = "Testing Applications"
ab = Session .AddressBook
recips = AB.ShowAddressBook(Msg.Recipients) /* This is the line that
the error message is for BUT this does actually show the addressbook
but if the user clicks cancel this line then reports the error and
dies. I have debugged it and it is dying on this line.
Msg.Recipients = Recips
Any help would be greatly appreciated.
Thanks