I couldn't find anywhere to write a specific document on this so i figured I'd start it here till i found out where you post this stuff.
There was this puzzling feature we needed over here at our company. We spent numerous amount of time looking for this, not getting much help on the forums, i finally figured it out and figured i'd share it. If you already knew this sorry, if not i hope this helps.
Well here's the example i used.
There was this puzzling feature we needed over here at our company. We spent numerous amount of time looking for this, not getting much help on the forums, i finally figured it out and figured i'd share it. If you already knew this sorry, if not i hope this helps.
Well here's the example i used.
Code:
DO WITH FRAME {&FRAME-NAME}:
DEFINE VARIABLE attach-name AS CHARACTER NO-UNDO.
DEFINE VARIABLE Folder AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE MailItem AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE message-text AS CHARACTER NO-UNDO.
DEFINE VARIABLE NameSpace AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE Outlook AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE Recipient AS COM-HANDLE NO-UNDO.
CREATE "Outlook.Application" Outlook.
ASSIGN
NameSpace = Outlook:GetNameSpace("MAPI":U)
Folder = NameSpace:GetDefaultFolder(6)
attach-name = scr-Attach:SCREEN-VALUE.
ASSIGN
MailItem = Folder:Items:Add()
MailItem:To = TRIM(scr-To:SCREEN-VALUE)
MailItem:Subject = TRIM(scr-Subject:SCREEN-VALUE)
MailItem:Body = TRIM(ed-Body:SCREEN-VALUE)
MailItem:CC = TRIM(scr-CC:SCREEN-VALUE)
MailItem:Bcc = TRIM(scr-BCC:SCREEN-VALUE)
MailItem:Importance = rs-priority:SCREEN-VALUE.
/* This is for Delivery Receipts */
MailItem:OriginatorDeliveryReportRequested = IF tDilivReceipt:SCREEN-VALUE = "YES"
THEN TRUE ELSE FALSE. /* Logical */
/* This is for Read Receipts */
MailItem:ReadReceiptRequested = IF tReadReceipt:SCREEN-VALUE = "YES"
THEN TRUE ELSE FALSE. /* LOGical */
/* This is to send on behalf */
IF scr-BehalfOf:SCREEN-VALUE <> "" THEN
MailItem:SentOnBehalfOfName = scr-BehalfOf:SCREEN-VALUE. /*String Email*/
IF scr-Attach:SCREEN-VALUE <> "" THEN
MAilItem:Attachments:ADD(attach-name).
MailItem:SEND().
RELEASE OBJECT MailItem NO-ERROR.
RELEASE OBJECT Folder NO-ERROR.
RELEASE OBJECT NameSpace NO-ERROR.
RELEASE OBJECT Outlook NO-ERROR.
RELEASE OBJECT Recipient NO-ERROR.
END.
END PROCEDURE.