AutoHotkey Community

It is currently May 26th, 2012, 9:47 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: May 16th, 2005, 1:01 pm 
Offline

Joined: April 7th, 2004, 2:43 pm
Posts: 62
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 17th, 2005, 1:16 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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).


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: iBob35555VR, just me, krajan and 64 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group