Range("B" & lRow).Value = olMail.SenderName Range("A" & lRow).Value = olMail.Subject '~~> Code here to output data from email to Excel File LRow = oXLws.Range("A" & ).End(xlUp).Row + 1 Set oXLApp = CreateObject("Excel.Application") '~~> If not found then create new instance Set oXLApp = GetObject(, "Excel.Application") '~~> Establish an EXCEL application object Set olNS = Application.GetNamespace("MAPI") When the new email arrives not only will the email move to the folder that you specify but data from it will be exported to Excel as well.ĭim strID As String, olNS As Outlook.Namespaceĭim oXLApp As Object, oXLwb As Object, oXLws As Object In the box below, specify the specific folder and also the script (the macro that you have in module) to run.Select "move it to specified folder" and also select "run a script" in the same box.Type the word that you want to check in the dialog box that pops up and click on "add".Click on "specific words" under rules description.Under conditions, click on "with specific words in the subject". Select "Check messages When they arrive".I have commented the code so that you will not face any problem understanding it.įirst paste the below mentioned code in the outlook module. You can run the macro on the incoming mail and then move it to the folder at the same time. Since you have not mentioned what needs to be copied, I have left that section empty in the code below.Īlso you don't need to move the email to the folder first and then run the macro in that folder.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |