Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

programmin outlook97

Posted on 2000-04-28
3
Medium Priority
?
163 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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

886 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