Adding attachments through code

  • Thread starter Thread starter Pete Glynn
  • Start date Start date
P

Pete Glynn

I would like to attach one or more files (mainly Word documents, pdf and tif
files) to messages through code. The Add method of the Attachments object
works fine provided recipients are using Outlook as their email client but
recipients using Pegasus, Eudora etc (i.e. most of them) only ever see a
single Winmail.dat file attachment which they cannot read. There is no
problem for these users when attachments are added through the Outlook user
interface. I have tried using the Add method of the CDO Attachments
collection but have not had any success with this either so far.

I know this is part of a wider problem involving rich text and TNEF but is
it at all possible to add file attachments through code without causing this
problem and if so what am I missing? I'd really appreciate any information
on this because I've been banging my head against this particular brick wall
for some time now and it's getting seriously uncomfortable. (I'm using
Outlook 2000 in IMO mode and CDO 1.21).

Thanks,
Pete
 
A code snippet would be helpful. How are you setting the
address on the message? Also, why CDO and not Outlook?
Unless you're setting the Body property or using a custom
form, just adding an attachment with Outlook objects
shouldn't create a Winmail.dat RTF attachment.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Back
Top