Hi.
The code you provided can open the ".msg" file in forward mode but "From.." option in outlook is showing the person's name from whom the mail has been originally received. This is why the mail cannot be forwarded clicking the send button. Please tell me how to change the original "From.." to the current sender's 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