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.