Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to retrieve mail from only a specific person through Outlook using VB.Net?
    primarykey
    data
    text
    <p>I got the following code from <a href="http://www.codeproject.com/KB/aspnet/extract_oulook_2003_NET.aspx?" rel="nofollow">codeproject.com</a>: </p> <pre><code> Dim objOL As Outlook.Application Dim objNS As Outlook.NameSpace Dim objFolder As Outlook.Folders Dim Item As New Object Dim myItems As Outlook.Items Dim x As Int16 objOL = New Outlook.Application() objNS = objOL.GetNamespace("MAPI") Dim olfolder As Outlook.MAPIFolder olfolder = objOL.GetNamespace("MAPI").PickFolder myItems = olfolder.Items Dim i As Integer For x = 1 To myItems.Count MessageBox.Show(myItems.Item(x).SenderName) MessageBox.Show(myItems.Item(x).SenderEmailAddress) MessageBox.Show(myItems.Item(x).Subject) MessageBox.Show(myItems.Item(x).Body) MessageBox.Show(myItems.Item(x).to) MessageBox.Show(myItems.Item(x).ReceivedByName) MessageBox.Show(myItems.Item(x).ReceivedOnBehalfOfName) MessageBox.Show(myItems.Item(x).ReplyRecipientNames) MessageBox.Show(myItems.Item(x).SentOnBehalfOfName) MessageBox.Show(myItems.Item(x).CC) MessageBox.Show(myItems.Item(x).ReceivedTime) Next x Dim Atmt As Outlook.Attachment For Each Atmt In Item.Attachment Dim filename As String = "C:\Email Attachments\" + Atmt.FileName Atmt.SaveAsFile(filename) Next Atmt </code></pre> <p>Now, I got as far as making the default folder the Inbox. What I would like to do is to extend the functionality by retrieving only a specific person's emails and extracting and saving whatever attachments he/she sends. Also, I get the following error when the code reaches the<br> <code>Dim Atmt as Outlook.Attachment</code> part: <strong>Public member 'Attachment' on type 'Object' not found.</strong> I need this function to retrieve the attachments. I've tried different things, but nothing's worked. Can you please help me?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload