问题
Would it be possible to attach PDF from MemoryStream or other functions to Outlook E-Mail Items MailItem.Attachment.add(), rather than from the file on the hard disk by passing the physical path of file in this method.
I would like to create the Outlook mailitem for the users with the PDF attached programmatically, and let the users to review and send out the email by themselves.
Thank you in advance.
回答1:
Not using the Outlook Object Model - Attachments.Add will only let you pass a file name for the olByValue
attachments. Extended MAPI (C++ or Delphi) only operates on IStream objects (IAttach::OpenProperty(PR_ATTACH_DATA_BIN, IID_IStream,...)
), Redemption lets you pass file name, url, array, IStream or IStorage to RDIOAttachments.Add.
来源:https://stackoverflow.com/questions/39071261/programmatically-attach-pdf-from-memorystream-to-outlook-e-mail-items