Solved

Email Attachment with Outlook

Posted on 1998-12-16
1
205 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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now