Imports System
Imports System.Reflecti on
Imports Outlook = Microsoft.Offic e.Interop.Outlo ok
Namespace PACKERSROCK
Public Class VIKINGSSUCK
Public Shared Function Main() As Integer
Try
Dim oApp As Microsoft.Offic e.Interop.Outlo ok.Application =
New Outlook.Applica tion()
Dim oNS As Outlook.NameSpa ce = oApp.GetNamespa ce("mapi")
oNS.Logon(Missi ng.Value, Missing.Value, False, True)
Dim oInbox As Outlook.MAPIFol der =
oNS.GetDefaultF older(Outlook.O lDefaultFolders .olFolderInbox)
Dim oItems As Outlook.Items = oInbox.Items
Dim oMsg As Outlook.MailIte m = CType(oItems.Ge tFirst(),
Outlook.MailIte m)
'Check for attachments.
Dim AttachCnt As Integer = oMsg.Attachment s.Count
Debug.WriteLine ("Attachment s: " + AttachCnt.ToStr ing())
If AttachCnt > 0 Then
Dim i As Integer
For i = 1 To AttachCnt Step i + 1
Debug.WriteLine (i.ToString() + "-" +
oMsg.Attachment s(i).DisplayNam e)
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******@discu ssions.microsof t.com> wrote in message
news:BB******** *************** ***********@mic rosoft.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