Redemption CopyTo(CDO.Message)

  • Thread starter Thread starter charles.lanteigne
  • Start date Start date
C

charles.lanteigne

I am trying to access Outlook message attachments data more
efficiently.

Right now, I am using Redemption.Attachment.SaveAsFile() and then I
load them back in a Stream with ADODB.Stream.LoadFromFile(), but that
adds a significant overhead in read/write time, which I hope I could
avoid. Yes, I know Redemption provides AsText()/AsArray() for
attachments, but these crash [out of memory] when processing large
attachments.

I stumbled on something in the Redemption History which cought my
attention immediately:
All Redemption items have a CopyTo() method which allows to copy
a Redemption item into any Outlook Object Model or CDO message.

Being able to copy a MailItem into a CDO.Message would mean that I
could access the attachments data using an ADODB.Stream. The problem
is that if I try this litterally, as in this little piece of code:

' "smi" is a Redemption.SafeMailItem
Dim msg As New CDO.Message
Call smi.CopyTo(msg) '<-- error

I get the following error:
Run-time error '-2147418113 (8000ffff)':
Method 'MAPIOBJECT' not supported by automation object

What am I getting wrong? I am using "VB6" and "CDO for Windows 2000".
Or is there another way to do what I am trying to do (access
attachment data more efficiently)?

Thanks for your help.
 
That refers to CDO 1.21, not CDO for Windows or any of the many other CDO's.
You would need to install the optional CDO component from the Office CD or
download it from MS if you're using Outlook 2007. It's no longer on the
Office CD in Office 2007.




I am trying to access Outlook message attachments data more
efficiently.

Right now, I am using Redemption.Attachment.SaveAsFile() and then I
load them back in a Stream with ADODB.Stream.LoadFromFile(), but that
adds a significant overhead in read/write time, which I hope I could
avoid. Yes, I know Redemption provides AsText()/AsArray() for
attachments, but these crash [out of memory] when processing large
attachments.

I stumbled on something in the Redemption History which cought my
attention immediately:
All Redemption items have a CopyTo() method which allows to copy
a Redemption item into any Outlook Object Model or CDO message.

Being able to copy a MailItem into a CDO.Message would mean that I
could access the attachments data using an ADODB.Stream. The problem
is that if I try this litterally, as in this little piece of code:

' "smi" is a Redemption.SafeMailItem
Dim msg As New CDO.Message
Call smi.CopyTo(msg) '<-- error

I get the following error:
Run-time error '-2147418113 (8000ffff)':
Method 'MAPIOBJECT' not supported by automation object

What am I getting wrong? I am using "VB6" and "CDO for Windows 2000".
Or is there another way to do what I am trying to do (access
attachment data more efficiently)?

Thanks for your help.
 
Back
Top