VFP 愛用者社區 首頁 VFP 愛用者社區
本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
 
 常見問題常見問題   搜尋搜尋   會員列表會員列表   會員群組會員群組   會員註冊會員註冊 
 個人資料個人資料   登入檢查您的私人訊息登入檢查您的私人訊息   登入登入

請問高手們 , 我如果有一個 HTM 檔案 想要利用 Outlook 或 其他方式寄出 ,但我不要以附加檔案方式

 
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區
上一篇主題 :: 下一篇主題  
發表人 內容
kueisen1



註冊時間: 2005-02-20
文章: 27


第 1 樓

發表發表於: 星期四 六月 23, 2005 3:52 pm    文章主題: 請問高手們 , 我如果有一個 HTM 檔案 想要利用 Outlook 或 其他方式寄出 ,但我不要以附加檔案方式 引言回覆

請問高手們 , 我如果有一個 HTM 檔案 想要利用 Outlook 或 其他方式寄出 ,

但我不要以附加檔案方式 ,而要在 Mail 的本文中顯示 , 那要如何處理 謝謝 !!
回頂端
檢視會員個人資料 發送私人訊息
garfield
Site Admin


註冊時間: 2003-01-30
文章: 2160


第 2 樓

發表發表於: 星期四 六月 23, 2005 4:21 pm    文章主題: 引言回覆

資料來源: http://www.outlookcode.com/d/code/htmlimg.htm
代碼:

Sub EmbeddedHTMLGraphicDemo()
  ' Outlook objects
  Dim objApp as Outlook.Application
  Dim l_Msg As MailItem
  Dim colAttach As Outlook.Attachments
  Dim l_Attach As Outlook.Attachment
  Dim oSession As MAPI.Session
  ' CDO objects
  Dim oMsg As MAPI.Message
  Dim oAttachs As MAPI.Attachments
  Dim oAttach As MAPI.Attachment
  Dim colFields As MAPI.Fields
  Dim oField As MAPI.Field
 
  Dim strEntryID As String
 
  ' create new Outlook MailItem
  Set objApp = CreateObject("Outlook.Application")
  Set l_Msg = objApp.CreateItem(olMailItem)
  ' add graphic as attachment to Outlook message
  ' change path to graphic as needed
  Set colAttach = l_Msg.Attachments
  Set l_Attach = colAttach.Add("c:\test\graphic.jpg")
  l_Msg.Close olSave
  strEntryID = l_Msg.EntryID
  Set l_Msg = Nothing
  ' *** POSITION CRITICAL *** you must dereference the
  ' attachment objects before changing their properties
  ' via CDO
  Set colAttach = Nothing
  Set l_Attach = Nothing
   
  ' initialize CDO session
  On Error Resume Next
  Set oSession = CreateObject("MAPI.Session")
  oSession.Logon "", "", False, False
 
  ' get the message created earlier
  Set oMsg = oSession.GetMessage(strEntryID)
  ' set properties of the attached graphic that make
  ' it embedded and give it an ID for use in an <IMG> tag
  Set oAttachs = oMsg.Attachments
  Set oAttach = oAttachs.Item(1)
  Set colFields = oAttach.Fields
  Set oField = colFields.Add(CdoPR_ATTACH_MIME_TAG, "image/jpeg")
  Set oField = colFields.Add(&H3712001E, "myident")
  oMsg.Fields.Add "{0820060000000000C000000000000046}0x8514", 11, True
  oMsg.Update
 
  ' get the Outlook MailItem again
  Set l_Msg = objApp.GetNamespace("MAPI").GetItemFromID(strEntryID)
  ' add HTML content -- the <IMG> tag
  l_Msg.HTMLBody = "<IMG align=baseline border=0 hspace=0 src=cid:myident>"
  l_Msg.Close (olSave)
  l_Msg.Display
 
  ' clean up objects
  Set oField = Nothing
  Set colFields = Nothing
  Set oMsg = Nothing
  oSession.Logoff
  Set oSession = Nothing
  Set objApp = Nothing
  Set l_Msg = Nothing
End Sub

_________________
利用>>搜尋<<的功能會比問的還要快得到答案.
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件
syntech



註冊時間: 2003-05-16
文章: 4249
來自: Taipei,Taiwan

第 3 樓

發表發表於: 星期四 六月 23, 2005 4:26 pm    文章主題: 引言回覆

查 OUTLOOK 的 ITEM.HTMLBODY

outlook express 好像不行,請自行查證

_________________
如果公司有下列困擾:
1. 找不到便宜,快速,簡易的 生產排程軟體
2. 不知道如何快速排定 採購計劃
3. 成本抓不準,自己算比軟體算有用
4. 想學習系統規劃,想找系統架構的顧問

請聯絡我們,也許我們幫得上忙
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件 AIM Address
從之前的文章開始顯示:   
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區 所有的時間均為 台北時間 (GMT + 8 小時)
1頁(共1頁)

 
前往:  
無法 在這個版面發表文章
無法 在這個版面回覆文章
無法 在這個版面編輯文章
無法 在這個版面刪除文章
無法 在這個版面進行投票
無法 在這個版面附加檔案
無法 在這個版面下載檔案


Powered by phpBB © 2001, 2005 phpBB Group
正體中文語系由 phpbb-tw 維護製作