Solved

Email Attachment with Outlook

Posted on 1998-12-16
1
209 Views
Last Modified: 2010-08-05
How can I attach a file to my email using the object OUTLOOK?
0
Comment
Question by:lohvinenko
1 Comment
 
LVL 3

Accepted Solution

by:
vmano earned 50 total points
ID: 1450552
Sub NewMailWithAttachment()
' The Outlook object library needs to be referenced
 Dim ol As Outlook.Application
 Dim NewMessage As Object

 Set ol = New Outlook.Application
 ' Create a new MailItem
 Set NewMessage = ol.CreateItem(olMailItem)
 ' Embed a file into the new message
 NewMessage.Attachments.Add "c:\autoexec.bat", olByValue
 ' Display the message
 NewMessage.Display
End Sub

hope this helps
vmao

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB6 Compile Compatibility Issue 4 121
VB6 - Compare and highlight cell not the same 3 56
Hide vba in gp 7 113
Copy a range from 1..n excel sheets to one destination sheet 2 66
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question