windows - Save Outlook Email as text file, and then run a script on it? -


i'm using outlook 2007. have no experience windows programming or vba, of background on unix systems. attempting have outlook save each incoming emails text file, , run python script parse text file.

i found this question seems provide vba code accomplish first task, i'm not sure how utilize it. open visual basic editor, have no idea how proceed there. tried saving text module, when attempt add "run script" in outlook rule, no scripts available. doing wrong?

edit: clarification.

i'm assuming you're familiar coding @ some level, if not on windows. may want general background reading on outlook vba; resources on microsoft article, this article outlookcode, , on - there's ton of resources out there walkthroughs , examples.

addressing specific question: take @ this microsoft kb article, describes how trigger script rule.

the key getting started once you've gotten vba editor open double-click module on left, example thisoutlooksession (under 'microsoft outlook objects'). should give editor can paste code into. bear in mind (per above ms page) procedure must accept mailitem object, item rule has in hand, linked example gave have first couple of lines changed from:

sub saveemail()     dim msg outlook.mailitem     ' assume email selected     set msg = activeexplorer.selection.item(1)     ' save text     [...] 

...to:

sub saveemail(msg outlook.mailitem)     ' save text     [...] 

essentially you're being handed mailitem rather having create , connect selected item in outlook.

to achieve second task of 'running script' on file, i'm assuming want vba make changes file after it's been saved? pretty straightforward in vba, , you'll find lots of examples it. 1 pretty simple outline in this answer.

edit based on comments: launch external tool, can use either shell command if don't need wait complete, or can use 1 of many shell-and-wait implementations floating around, example this popular one. or, can use wscript approach in this answer.

note you'll need ensure outlook set allow macros run, , want sign code.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -