AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to retreive From & Subject field in Outlook2003

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Payam



Joined: 07 Apr 2004
Posts: 58

PostPosted: Mon May 16, 2005 1:01 pm    Post subject: How to retreive From & Subject field in Outlook2003 Reply with quote

I've searched the forum but couldn't find a topic about this

In Microsoft Outlook 2003, I can't seem to get the From nor Subject text of an email (in the "reading pane), even though I do have their unique Control names (RichEdit20WPT1 and RichEdit20WPT2 respectively).

Here's a sample usage:


Code:
SetTitleMatchMode,Slow

;VARIABLES
wintitle = Inbox - Microsoft Outlook

check:

WINWAITACTIVE,%wintitle%

GoSub,getheaders

Sleep,300

Goto,check

Return

GETHEADERS: ;will get subject, sender, email content

;get subject
ControlGetText, subjectfield,RichEdit20WPT1,%wintitle%

;get from field
ControlGetText, fromfield,RichEdit20WPT2,%wintitle%

;get body field
;ControlGetText, bodyfield,RichEdit20W5,%wintitle%  <--this works


ToolTip, FROM: %fromfield%`n`nSUBJECT: %subjectfield%`n`nBODY: %bodyfield%
RETURN




Any other method/suggestion to retreive this info within Outlook? Thanks
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Tue May 17, 2005 1:16 pm    Post subject: Reply with quote

I suspect the %wintitle% might be wrong. Shouldn't it be the title of the e-mail window itself (but maybe you're using the preview mode)?

I tried the following on Outlook 2002 while an e-mail message window was open. It seems able to get the subject:
Code:
IfWinNotExist, ahk_class rctrl_renwnd32
   return
ControlGetText, Subject, RichEdit20W6  ; Uses the window found above.
MsgBox Subj: %Subject%

Also, if you can see the text with Window Spy, ControlGetText should be able to get it too (and there is no need to switch to SetTitleMatchMode Slow).
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group