Solved

Email Attachment with Outlook

Posted on 1998-12-16
1
211 Views
Last Modified: 2010-08-05
How can I attach a file to my email using the object OUTLOOK?
0
Comment
Question by:lohvinenko
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses
Course of the Month9 days, 12 hours left to enroll

623 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