De: Eric Sabine Objet: Re: Email addresses from Mailing List to Email program Date : vendredi 19 novembre 1999 14:27 Place this code exactly as it is in a new module and call the macro sSendEmail from a command button or something. HTH Eric '************ Code Start ********** Private declare function apiShellExecute 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 '***App Window Constants*** Const WIN_NORMAL = 1 'Open Normal Const WIN_MAX = 2 'Open Maximized Const WIN_MIN = 3 'Open Minimized '***Error Codes*** Private Const ERROR_SUCCESS = 32& Private Const ERROR_NO_ASSOC = 31& Private Const ERROR_OUT_OF_MEM = 0& Private Const ERROR_FILE_NOT_FOUND = 2& Private Const ERROR_PATH_NOT_FOUND = 3& Private Const ERROR_BAD_FORMAT = 11& Sub sSendEmail() dim strEmail As String dim x strEmail = application.inputbox("select Email address cell") x = fHandleFile("mailto:" & strEmail, WIN_NORMAL) end Sub 'This code was originally written by Dev Ashish. 'It is not to be altered or distributed, 'except as part of an application. 'You are free to use it in any application, 'provided the copyright notice is left unchanged. ' 'Code Courtesy of 'Dev Ashish '***************Usage Examples*********************** 'Open a folder: ?fHandleFile("C:\TEMP\",WIN_NORMAL) 'Call Email app: ?fHandleFile("mailto:dash10@hotmail.com",WIN_NORMAL) 'Open URL: ?fHandleFile("http://home.att.net/~dashish", WIN_NORMAL) 'Handle Unknown extensions (call Open with Dialog): ' ?fHandleFile("C:\TEMP\TestThis",Win_Normal) 'Start Access instance: ' ?fHandleFile("I:\mdbs\CodeNStuff.mdb", Win_NORMAL) '**************************************************** function fHandleFile(stFile As String, lshowHow As long) dim lRet As long, varTaskID As Variant dim stRet As String 'First try ShellExecute lRet = apiShellExecute(hWndAccessApp, vbNullString, _ stFile, vbNullString, vbNullString, lshowHow) if lRet > ERROR_SUCCESS then stRet = vbNullString lRet = -1 Else select Case lRet Case ERROR_NO_ASSOC: 'Try the Openwith dialog varTaskID = Shell("rundll32.exe shell32.dll,OpenAs_runDLL " _ & stFile, WIN_NORMAL) lRet = (varTaskID <> 0) Case ERROR_OUT_OF_MEM: stRet = "Error: Out of Memory/Resources. Couldn't Execute!" Case ERROR_FILE_NOT_FOUND: stRet = "Error: File not found. Couldn't Execute!" Case ERROR_PATH_NOT_FOUND: stRet = "Error: Path not found. Couldn't Execute!" Case ERROR_BAD_FORMAT: stRet = "Error: Bad File format. Couldn't Execute!" Case Else: end select end if fHandleFile = lRet & _ Iif(stRet = "", vbNullString, ", " & stRet) end function '************ Code end ********** wrote in message news:8133h5$9lr$1@nnrp1.deja.com... > I have a mailing list on Excel 97 that contains email addresses. > > Can I take them from the spreadsheet and put them into the TO: section > of my email program? > > This is a "work" system that is based around Lotus Notes. > > > Thanks in anticipation folks and have a nice weekend. > > > CASE! > > > Sent via Deja.com http://www.deja.com/ > Before you buy.