Thanks, David and Normandy.
Let me make my question more clear.
1. We have foxpro 2.6a , MS outlook and exchange 4.5
2. Inside foxpro application, I need to add one "Email" button. When a user hit the button, A message (with attachments) is auto sent to email address on the same screen.
3. The user just got a confirmation message whether the message was sent or not.
4. email program wmay use exchange service directly or
use outlook object to auto send out message. HOW ?
5. I have outlook vbs script as below, I have to use "Run ..." to run it. And a DOS screen popup, How can I call script directly inside forpro, not through DOS command.
Her is the VBS script. To run it, save it to "email.vbs"; then at DOS prompt,type "Wscript email.vbs"
--------------
set objoutlook=CreateObject("Outlook.Application"

set objmail=objoutlook.CreateItem(0)
objmail.Recipients.Add("mengzs@yahoo.com"

objmail.Subject = "Email Script Test"
objmail.cc = "mengzs@yahoo.com"
objmail.Body = vbcrlf&" Body Message Here."
objmail.Attachments.Add("c:\autoexec.bat"

objmail.Send
objoutlook.quit
set objmail=nothing
set objoutlook=nothing