Imports System
Imports System.Reflection
Imports Outlook = Microsoft.Office.Interop.Outlook
Namespace PACKERSROCK
Public Class VIKINGSSUCK
Public Shared Function Main() As Integer
Try
Dim oApp As Microsoft.Office.Interop.Outlook.Application =
New Outlook.Application()
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
oNS.Logon(Missing.Value, Missing.Value, False, True)
Dim oInbox As Outlook.MAPIFolder =
oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFo lderInbox)
Dim oItems As Outlook.Items = oInbox.Items
Dim oMsg As Outlook.MailItem = CType(oItems.GetFirst(),
Outlook.MailItem)
'Check for attachments.
Dim AttachCnt As Integer = oMsg.Attachments.Count
Debug.WriteLine("Attachments: " + AttachCnt.ToString())
If AttachCnt > 0 Then
Dim i As Integer
For i = 1 To AttachCnt Step i + 1
Debug.WriteLine(i.ToString() + "-" +
oMsg.Attachments(i).DisplayName)
Next
End If
oMsg.SaveAs("C:\TESTMSG.DOC", Nothing)
oNS.Logoff()
oMsg = Nothing
oItems = Nothing
oInbox = Nothing
oNS = Nothing
oApp = Nothing
'End Try
'Error handler.
Catch e As Exception
Debug.WriteLine("{0} Exception caught: ", e.ToString)
' Return value.
Return 0
End Try
End Function
End Class
End Namespace
--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com
"tom north" <to******@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
What I am after would be a VB script perhaps using CDO to access the inbox
of
a mailbox, and push or pull messages in or out to a flat file directory on
disk
--
Tom North