![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I've seen lots of discussion on this but no answers.
I have an addin (VB.NET and VSTO) that strips attachements from emails as they are sent. Trouble is, I don't want to strip attachement (usually images) that are within the body of the message. I quite often paste images from the clipboard into my HTML messages and these need to be retained. So when looping through the attachments in a message how can you robustly check if the attachment is embedded or not? Based on other articles I've seen I thought something like this might work by actually oAttachments.Type doesn't seem to be any different between an attached XLS file and an embedded JPG file. Private Function HasNonEmbeddedAttachements() As Boolean Dim retval As Boolean = False Dim oAttachment As Outlook.Attachment If m_olMailItem.Attachments.Count = 0 Then retval = False Else For Each oAttachment In m_olMailItem.Attachments If oAttachment.Type = Outlook.OlAttachmentType.olByValue Then retval = False Else retval = True Exit For End If Next End If Return retval End Function |
Ads |
#2
|
|||
|
|||
![]()
May have found a simple way.....seems to work at least but will test for a
while first Private Function HasNonEmbeddedAttachements() As Boolean Dim retval As Boolean = False Dim oAttachment As Outlook.Attachment If m_olMailItem.Attachments.Count = 0 Then retval = False Else For Each oAttachment In m_olMailItem.Attachments If m_olMailItem.HTMLBody.ToLower.Contains("cid:" & oAttachment.FileName) = True Then retval = False Else retval = True Exit For End If Next End If Return retval End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Detecting whether a toolbar is and should be shown | Brunwin | Outlook and VBA | 7 | March 10th 09 07:55 PM |
detecting new mail in shared mailbox | Mark VII | Outlook and VBA | 2 | April 22nd 08 10:08 PM |
Detecting the .ActiveWindow() w/C# | Vic[_2_] | Outlook - General Queries | 1 | October 24th 07 08:21 PM |
Detecting when Appointment Occurs | mwernerps2 via OfficeKB.com | Add-ins for Outlook | 1 | October 21st 07 12:29 AM |
detecting when Word is being used to compose email ? | Mark Beiley | Add-ins for Outlook | 5 | July 23rd 07 07:35 AM |