 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Payam
Joined: 07 Apr 2004 Posts: 58
|
Posted: Mon May 16, 2005 1:01 pm Post subject: How to retreive From & Subject field in Outlook2003 |
|
|
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 |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Tue May 17, 2005 1:16 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|