$PBExportHeader$f_run_outlook.srf global type f_run_outlook from function_object end type forward prototypes global subroutine f_run_outlook (string as_email_title, string as_email_add, string as_email_attach) end prototypes global subroutine f_run_outlook (string as_email_title, string as_email_add, string as_email_attach);string ls_outlook,ls_attach,ls_addressee,ls_run_string,ls_path string ls_temp int li_ret //Microsoft Outlook 程序所在安全路径 //ls_outlook = "C:\Program Files\Microsoft Office\Office12\outlook.exe" //office2010 li_ret = RegistryGet("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot",& "Path", RegString!, ls_outlook) if li_ret = 1 then goto nxt end if //office2007 li_ret = RegistryGet("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Common\InstallRoot",& "Path", RegString!, ls_outlook) if li_ret = 1 then goto nxt end if //office2003 li_ret = RegistryGet("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Common\InstallRoot",& "Path", RegString!, ls_outlook) if li_ret = 1 then goto nxt end if ls_outlook = "C:\Program Files\Microsoft Office\Office\" nxt: ls_outlook += "outlook.exe" //收件人信箱 //ls_addressee = "ferryman@163.net" //添加附件 //ls_attach = "c:\test.txt" //生成完整的执行命令 ls_run_string = '"' + ls_outlook + '" /c IPM.Note ' if ls_addressee <> "" then ls_run_string += ' /m ' + ls_addressee end if if ls_path <> "" then ls_run_string += ' /a' + ls_path end if //执行程序 run(ls_run_string) end subroutine