I've got this working, but it doesn't import the whole message body, and stop after 665 characters. Do I need another data type instead of string? Code follows..
Ta much
G..
Dim sBodyContents As String
Set myolApp = CreateObject("Outlook.Application")
Set myNameSpace = myolApp.GetNamespace("MAPI")
Set NewItemsFolder = myNameSpace.Folders("Public Folders").Folders("All Public Folders").Folders("BMS").Folders("ServiceDevelopment")
Set ProcessedItemsFolder = myNameSpace.Folders("Public Folders").Folders("All Public Folders").Folders("BMS").Folders("ServiceDevelopment").Folders("Processed")
'Get latest email data
If NewItemsFolder.Items.Count = 0 Then
MsgBox "No New Emails"
Else
For iCount = 1 To NewItemsFolder.Items.Count
sBodyContents = NewItemsFolder.Items(iCount).Body
MsgBox Len(varBodyContents)
NewItemsFolder.Items(iCount).Move ProcessedItemsFolder
Next
End If
Ta much
G..
Dim sBodyContents As String
Set myolApp = CreateObject("Outlook.Application")
Set myNameSpace = myolApp.GetNamespace("MAPI")
Set NewItemsFolder = myNameSpace.Folders("Public Folders").Folders("All Public Folders").Folders("BMS").Folders("ServiceDevelopment")
Set ProcessedItemsFolder = myNameSpace.Folders("Public Folders").Folders("All Public Folders").Folders("BMS").Folders("ServiceDevelopment").Folders("Processed")
'Get latest email data
If NewItemsFolder.Items.Count = 0 Then
MsgBox "No New Emails"
Else
For iCount = 1 To NewItemsFolder.Items.Count
sBodyContents = NewItemsFolder.Items(iCount).Body
MsgBox Len(varBodyContents)
NewItemsFolder.Items(iCount).Move ProcessedItemsFolder
Next
End If