Solved

programmin outlook97

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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…
Suggested Courses
Course of the Month8 days, 15 hours left to enroll

617 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