+ Reply to Thread
Results 1 to 3 of 3

CDO.Message seems to remove formatting from Excel file

  1. #1
    Rich
    Guest

    CDO.Message seems to remove formatting from Excel file

    I am creating an Excel file and then saving it to the hard drive. After
    it is saved, I send it with the following code:

    set objNewMail = CreateObject("CDO.Message")
    objNewmail.Subject = "My Subject"
    objNewMail.textBody = "Test of email"
    objNewMail.From = "me@mydomain.com"
    objNewMail.To = "you@yourdomain.com"
    objNewMail.AddAttachment "C:\myFile.xls"
    objNewMail.Send

    This excel file has some basic formatting (Bold header row that is
    underlined, a date column).

    When the file arrives in my email, all of the formatting is gone. All
    the rows have the same font and the date column is 38702 rather than a
    actual date like 12/16/2005.

    If i open the file from the harddrive it is fine.

    If I create a message with Outlook and send the file as an attachment,
    it is fine.

    Can anyone help with this?

    Thanks,

    Rich


  2. #2
    Rich
    Guest

    Re: CDO.Message seems to remove formatting from Excel file

    Answered my own question. For those with a similar issue, it seems you
    need to specify a few additional things:

    objNewMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    objNewMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
    "myserverl"
    objNewMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    objNewMail.Configuration.Fields.Update

    Details can be found at:
    http://www.microsoft.com/technet/scr..._ent_wbpa.mspx


  3. #3
    Ron de Bruin
    Guest

    Re: CDO.Message seems to remove formatting from Excel file

    See also

    http://www.rondebruin.nl/cdo.htm

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Rich" <richbashaw@yahoo.com> wrote in message news:1139931011.678311.97050@z14g2000cwz.googlegroups.com...
    > Answered my own question. For those with a similar issue, it seems you
    > need to specify a few additional things:
    >
    > objNewMail.Configuration.Fields.Item _
    > ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    > objNewMail.Configuration.Fields.Item _
    > ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
    > "myserverl"
    > objNewMail.Configuration.Fields.Item _
    > ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    > objNewMail.Configuration.Fields.Update
    >
    > Details can be found at:
    > http://www.microsoft.com/technet/scr..._ent_wbpa.mspx
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1