Solved

programmin outlook97

Posted on 2000-04-28
3
159 Views
Last Modified: 2010-05-02
I simply need to create one mail message and mail it to a distribution list.

The dist list is read in from a file, the msg body is stored in a string variable.

Can someone show me some vba code to create an outlook instance, insert the names into the "To:" field, Insert the msg and send the letter.

0
Comment
Question by:rutledgj
[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
3 Comments
 

Expert Comment

by:Surojitseal
ID: 2759699
Use the following code :-

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


Private Sub Command1_Click()
Dim x As Long
 x = ShellExecute(Form1.hwnd, "Open", "Mailto:someone@somewhere.com?Subject=Happy Birthday", " ", " ", 1)
End Sub



Thats all :)
0
 
LVL 6

Expert Comment

by:Marine
ID: 2759727
See this Link Scroll down there is a tutorial how you can do this.

http://msdn.microsoft.com/library/officedev/office97/web/005.htm#CH005H101
0
 
LVL 1

Accepted Solution

by:
jgravelle earned 100 total points
ID: 2759805
This is how you would go about it.

Dim appObj As New Outlook.Application
Dim itemObj As Object


Set itemObj = appObj.CreateItem(olMailItem)
itemObj.To = "To your dist list."
itemObj.Body = "Here is the body of the message"
itemObj.Subject = "Here is the Subject"
itemObj.Send

Set itemObj = Nothing
Set appObj = Nothing
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

734 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