Here你可以找到完整的代碼。這是太大,貼在這裏,所以我複製短短的幾行,以顯示想法:
If (bSetImages) Then
For iImageIndex = 0 To Ubound(imageFilePaths)
' Get the image file path and content id (cid).
strImagePath = Trim(imageFilePaths(iImageIndex))
If (strImagePath = "") Then Exit Sub
strImageCid = Trim(imageContentIds(iImageIndex))
If (strImageCid = "") Then Exit Sub
' Get the image context type.
If (StrContains(strImagePath, ".", True)) Then strImageExt = Strrightback(strImagePath, ".") Else strImageExt = ""
Select Case Lcase(strImageExt)
Case "gif": strImageType = "image/gif"
Case "jpg": strImageType = "image/jpg"
Case Else: strImageType = "image/gif"
End Select
' Add the image part.
Set mimeImage = mimeBody.CreateChildEntity()
Set mimeImageHeader = mimeImage.CreateHeader({Content-ID})
Call mimeImageHeader.SetHeaderVal("<" & strImageCid & ">")
Call stream.Open(strImagePath)
Call mimeImage.SetContentFromBytes(stream, strImageType & {;name="} + strImageCid + {"}, ENC_IDENTITY_BINARY)
Call stream.Close()
Next
End If
看到這裏的答案:http://stackoverflow.com/questions/3189622/insert-inline-image-into-lotus-notes-message – 2010-07-17 13:44:21