全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:712
推到 Plurk!
推到 Facebook!

動態建立OUTLOOK窗體會和當前已打開的OUTLOOK窗體重復?

尚未結案
longjibo
一般會員


發表:18
回覆:18
積分:12
註冊:2002-11-08

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-12-05 07:42:15 IP:218.16.xxx.xxx 未訂閱
如何避免動態建立OUTLOOK窗體會和當前已打開的OUTLOOK窗體重復? //代碼如下,請予以指教! Outlook, MailItem,Namespace,Folder: OLEVariant; curitem,curexplorer:OLevariant; //首先需判斷OUTLOOK是否存在于電腦中 try Outlook := CreateOleObject('Outlook.Application'); except application.MessageBox('請確認您的電腦中裝有OUTLOOK軟體!','注意!',mb_iconinformation mb_ok); Outlook := Unassigned; exit; end; MailItem:= Outlook.CreateItem(olMailItem); namespace:=outlook.getnamespace('MAPI'); Folder := Namespace.GetDefaultFolder(olFolderDrafts); MailItem.Recipients.Add(TRIM(query_email.Fieldbyname('EMAIL').AsString)); MailItem.Subject:='Current Report'; Mailitem.ReadReceiptRequested :=true;//need receipt note. if fileexists(‘c:\autoexec.bat’) then MailItem.Attachments.Add(‘c:\autoexec.bat’); mailitem.save; //在此處尋找電腦中是否已有OUTLOOK軟體開啟,若有則使OUTLOOK窗體成為當前窗體,否則顯示OUTLOOK窗體 //問題在于每次程序均會自動建立一個新的OUTLOOK窗體 oeHWnd:=findwindow(NiL,'草稿 - Microsoft Outlook'); if oeHwnd=NULL then curexplorer.display else begin outlook.activeexplorer.display; end; //若是我想讓最先建立的OUTLOOK窗體閃動標題欄呢?
系統時間:2024-06-02 1:47:47
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!