Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
i am using the following cource to attach a file to a outlook mail (thanks to Ron de Bruin): Sub TestFile() Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Dim cell As Range Application.ScreenUpdating = False Set OutApp = CreateObject("Outlook.Application") On Error GoTo cleanup For Each cell In Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants) If cell.Offset(0, 1).Value < "" Then If cell.Value Like "*@*" And Dir(cell.Offset(0, 1).Value) < "" Then Set OutMail = OutApp.CreateItem(olMailItem) With OutMail .To = cell.Value .Subject = "Testfile" .Body = "Hi " & cell.Offset(0, -1).Value .Attachments.Add cell.Offset(0, 1).Value .Display 'Or use Display End With Set OutMail = Nothing End If End If Next cell cleanup: Set OutApp = Nothing Application.ScreenUpdating = True End SubThe problem is, whenever i am trying to add a html file, Outlook pastes its content into the mail (i guess it comes from my outlook settings to send mail in html-format). How can i prevent from this? I do need to send it as attachement.Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Accessing Attached xls File | Excel Worksheet Functions | |||
Accessing Attached XLS file | Excel Worksheet Functions | |||
HELP with statistics on the attached file | Excel Discussion (Misc queries) | |||
cannot open excel files attached to outlook | Excel Discussion (Misc queries) | |||
Excel 2002 files attached to Outlook 2002 EMails change size | Excel Programming |