|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Move emails (.msg files) between an Outlook inbox and a file direcWhat 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 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.olFolderInbox) 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 -- Show quoteHide quoteGet a powerful web, database, application, and email hosting with KJM Solutions http://www.kjmsolutions.com "tom north" <tomno***@discussions.microsoft.com> wrote in message news:BBD4246B-5D53-4231-A05E-511D09651B2D@microsoft.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
Read Emails on Exchange server without OL client
VB2005 timing/speed problem single to string problem Error setting CSV to display text set focus from treeview to control How to move the mouse around in vb.net Invalid format of DLL How do I take a screenshot in VB.net 2005 How to simulate mouse click in vb.net get all controls collections |
|||||||||||||||||||||||