Jump to content

Reading An Email Into A File In Outlook


Recommended Posts

im trying to make a script that will read the contents of an email that i have open, once i double click on the email it opens the email in its own window. Well i attached the code ive got so far but it doesnt seem to work.

i used autoitwindow info to get the ClassNameNN: for the text i needed but the $var is empty. any ideas?

WinActivate ("emailtitle", "")
$var = ControlGetText("emailtitle", "", "renctl_tabbar1")
Msgbox (4096, "Test", $var)
Link to comment
Share on other sites

ok i think i answered my own question, using WinGetText works

another question though once i have the $var full of the email whats the best way to pull out an address?

lets say the email as a address like this

located at the following address: 2329 blah st new york, ny 89383

i need to be able to pull all of the address part and put it into a var. Edited by anyday
Link to comment
Share on other sites

  • Moderators

ok i think i answered my own question, using WinGetText works

another question though once i have the $var full of the email whats the best way to pull out an address?

lets say the email as a address like this

i need to be able to pull all of the address part and put it into a var.

Do you only plan on doing this when the email is open?

If not cameronsdad posted an example on here to maybe get you started. I'll look for it.

Edit:

Here are some links to look at.

http://www.autoitscript.com/forum/index.ph...ook.Application

http://www.autoitscript.com/forum/index.ph...ook.Application

http://www.autoitscript.com/forum/index.ph...ook.Application

http://www.autoitscript.com/forum/index.ph...ook.Application

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

yes while the email is open, now i just trying to figure out the best way to get the address out of the $var, the format is

located at the following address:

address here

i need to get the address into a $variable but the problem is the address is not always on the same line number, i tried saving the email to a file and use file read line but like i said the line # varies.

Link to comment
Share on other sites

Do a string search. Like, use the file read line, and if the line contains the string (ex. "Address"), save the whole line. Problem is if the address spans to more lines... also, you may get false-positives this way (the string "address" appearing somewhere else on the message).

Best if you could define start and ending strings (ex: Start=[address]xyxy[/address]), then you could get "xyxy", but I'm guessing you can't do that :think:

Edited by LKRaider
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...