Sign in to follow this  
Followers 0
anyday

Reading An Email Into A File In Outlook

5 posts in this topic

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)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0