What's the best language to automate this Windows task involving Outlook and Excel? 
I need to automate a particular task that involves:

* Fetching mails from my mailbox based on a set of criteria - from a particular user, has a particular pattern of subject line, etc. 

* Parsing the mail body of each mail and extracting some content (the mails have an almost fixed pattern)

* Creating an Excel sheet with a particular template (the first two lines are constant, the third line is the Monday and Friday of this week, etc.) and paste the content extracted above into this sheet in successive lines. 

* Creating an Outlook email message with the same content in a different format
* Attaching the above Excel sheet with this mail. 

(Finally sending it, but I don't want to automate that part - I like to double check things before sending out mails.)

Now, when I thought of automating this task, Perl's Win32::OLE came to mind immediately since I'd learnt about it recently, and am very comfortable in Perl. But then, I thought Visual Basic for Automation might be more suited for the task, since it is a language created for such tasks. 

My question is, is VBA better enough to offset the difference in my skillset between Perl and VB? I've played with VB6 when I was a kid years ago, but that's about the extent of my VB experience.    

I'm open to any other language/platform suggestions as well, provided they allow some flexibility and aren't too difficult to learn. I know some Python as well. 

I looked at [this](http://stackoverflow.com/questions/1818266/what-is-the-easiest-way-to-automate-excel-tasks) and also [this](http://stackoverflow.com/questions/1240096/automate-collection-of-data-from-outlook-msg-files-to-excel-field), [this](http://stackoverflow.com/questions/1177224/automating-outlook-and-word-to-create-email-message), [this](http://stackoverflow.com/questions/461869/automate-excel-file-processing-in-perl-and-avoid-dialog-ui-interactions) and [this](http://stackoverflow.com/questions/1140311/using-python-to-automate-creation-manipulation-of-excel-spreadsheets), but they either are not relevant, or do not have any good answers.

Thanks in advance,    
Sundar
What's the best language to automate this Windows task involving Outlook and Excel? 
===

I need to automate a particular task that involves:

* Fetching mails from my mailbox based on a set of criteria - from a particular user, has a particular pattern of subject line, etc. 

* Parsing the mail body of each mail and extracting some content (the mails have an almost fixed pattern)

* Creating an Excel sheet with a particular template (the first two lines are constant, the third line is the Monday and Friday of this week, etc.) and paste the content extracted above into this sheet in successive lines. 

* Creating an Outlook email message with the same content in a different format
* Attaching the above Excel sheet with this mail. 

(Finally sending it, but I don't want to automate that part - I like to double check things before sending out mails.)

Now, when I thought of automating this task, Perl's Win32::OLE came to mind immediately since I'd learnt about it recently, and am very comfortable in Perl. But then, I thought Visual Basic for Automation might be more suited for the task, since it is a language created for such tasks. 

My question is, is VBA better enough to offset the difference in my skillset between Perl and VB? I've played with VB6 when I was a kid years ago, but that's about the extent of my VB experience.    

I'm open to any other language/platform suggestions as well, provided they allow some flexibility and aren't too difficult to learn. I know some Python as well. 

I looked at [this](http://stackoverflow.com/questions/1818266/what-is-the-easiest-way-to-automate-excel-tasks) and also [this](http://stackoverflow.com/questions/1240096/automate-collection-of-data-from-outlook-msg-files-to-excel-field), [this](http://stackoverflow.com/questions/1177224/automating-outlook-and-word-to-create-email-message), [this](http://stackoverflow.com/questions/461869/automate-excel-file-processing-in-perl-and-avoid-dialog-ui-interactions) and [this](http://stackoverflow.com/questions/1140311/using-python-to-automate-creation-manipulation-of-excel-spreadsheets), but they either are not relevant, or do not have any good answers.

Thanks in advance,    
Sundar