Here's a code to open msg files from a folder, and send it to a mail id
Code:
Sub SendMSGFiles()
Dim objItemMSG As Object
Dim strFolderLocation As String
Dim objFolder As Object
Dim strFile As String
Dim olApp As Object
On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
Err.Clear: On Error GoTo 0: On Error GoTo -1
If olApp Is Nothing Then
Set olApp = CreateObject("Outlook.Application")
End If
Set objFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Select MSG folder location", 0, "")
If Not objFolder Is Nothing Then
strFolderLocation = objFolder.self.Path
Else
Exit Sub
End If
strFile = Dir(strFolderLocation & "\*.msg")
While strFile <> ""
Set objItemMSG = olApp.CreateItemFromTemplate(strFolderLocation & "\" & strFile)
objItemMSG.To = "abc@xyz.com"
objItemMSG.Send
strFile = Dir
Wend
End Sub
Bookmarks