LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
MD MD is offline
external usenet poster
 
Posts: 1
Default attached file using outlook

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Attached xls File shannyshanhan Excel Worksheet Functions 0 August 9th 06 10:04 PM
Accessing Attached XLS file shannyshanhan Excel Worksheet Functions 0 August 9th 06 02:57 AM
HELP with statistics on the attached file Swift Excel Discussion (Misc queries) 7 June 26th 06 03:34 AM
cannot open excel files attached to outlook Ohio Ray Excel Discussion (Misc queries) 1 July 27th 05 01:51 PM
Excel 2002 files attached to Outlook 2002 EMails change size AJStadlin Excel Programming 1 October 15th 03 12:12 AM


All times are GMT +1. The time now is 04:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"