Quantcast
Channel: All OutlookCode.com content
Viewing all articles
Browse latest Browse all 871

Problem adding Recipients while using redemption?

$
0
0
I have code using redemption that displays the send email dialog from an external application. I then use the ItemEvents.Send to add additional information to email. For each example I want to add myself to the cc of every email sent from this screen that prompts the users with the send email dialog. Solution 1 works only if i set CC in the code that is displaying the dialog to begin with. If i run it from the ItemEvents.Send i get an error the says "This Operation Failed" Solution 2 works perfectly how I want it to except that the Outlook Security Dialog pops up. Solution 3 is how I would do it with redemption. However it sends the message fine but never adds the cc recipient to the email nor includes them when it is sent out. So how can I use redemption for this? PROCEDURE ItemEvents.Send: DEFINE INPUT-OUTPUT PARAMETER oCancel AS LOGICAL. IF oCancel = FALSE THEN DO: FIND CURRENT ttETPQ NO-LOCK NO-ERROR. IF AVAIL ttETPQ THEN DO: RUN createNote(INPUT STRING(ttETPQ.etId), INPUT "EmpTrackerAnswer", INPUT ttETPQ.etEmployeeId, INPUT hSafeItem:TO, INPUT hSafeItem:Body). /* SOLUTION 1 */ /* Doesn't work either and get 'This Operation Failed' pop up */ /* hSafeItem:CC = "dpipes@blah.com". */ /* SOLUTION 2 */ /* Outlook works but prompted for security dialog */ /* DEFINE VARIABLE hRecipients AS COM-HANDLE NO-UNDO. hRecipients = hMail:Recipients:ADD("dpipes@blah.com"). hRecipients:resolve. IF hRecipients:resolved THEN hRecipients:TYPE = 2. */ /* SOLUTION 3 */ /* DEFINE VARIABLE hRecipients AS COM-HANDLE NO-UNDO. hRecipients = hSafeItem:Recipients:ADD("dpipes@blah.com"). hRecipients:resolve(TRUE). IF hRecipients:resolved THEN hRecipients:TYPE = 2. */ END. END. END PROCEDURE.

Viewing all articles
Browse latest Browse all 871

Trending Articles