Solved

programmin outlook97

Posted on 2000-04-28
3
157 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run code from text file in vb 1 64
How to make an ADE file by code? 11 83
Added a column screws up code 5 57
fso.FolderExists("\\server\HiddenFolder$") 4 64
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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

776 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