Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Run Macro Upon Receiving Email
#1
How would I go about triggering a macro to run upon receiving an email (in Outlook Express)?

Or alternatively, triggering a macro when certain information appears on a certain webpage?

Thanks for any help.
#2
This function runs all the time and launches macro "Macro150" whenever Outlook Express has new email. The function periodically looks for "You have new e-mail" tray icon. Works on Windows XP.

Function OE_new_mail_trigger:

Code:
Copy      Help
int is
rep
,1
,Acc a=acc("You have new e-mail" "PUSHBUTTON" "+Shell_TrayWnd" "ToolbarWindow32")
,if(a.a)
,,if(!is)
,,,is=1
,,,mac "Macro150"
,else is=0

To run this function when QM starts, insert this in function init2:

mac "OE_new_mail_trigger"


Alternatively, you can create a function that checks for new messages on POP3 server.

Similarly you can create a "text in a web page" trigger. Instead of looking for tray icon (acc), look for particular text in web page (htm).
#3
Thanks for your reply Gintaras. Would it be possible for an example of the 'search for text in a web page' thing? I've had a go but it doesn't seem to work :?

Thanks.

Gintaras Wrote:This function runs all the time and launches macro "Macro150" whenever Outlook Express has new email. The function periodically looks for "You have new e-mail" tray icon. Works on Windows XP.

Function OE_new_mail_trigger:

Code:
Copy      Help
int is
rep
,1
,Acc a=acc("You have new e-mail" "PUSHBUTTON" "+Shell_TrayWnd" "ToolbarWindow32")
,if(a.a)
,,if(!is)
,,,is=1
,,,mac "Macro150"
,else is=0

To run this function when QM starts, insert this in function init2:

mac "OE_new_mail_trigger"


Alternatively, you can create a function that checks for new messages on POP3 server.

Similarly you can create a "text in a web page" trigger. Instead of looking for tray icon (acc), look for particular text in web page (htm).
#4
there's already something about searching in web page in the forum. i dont have the url at hand but i remember trying to get it to work with firefox and it only working with ie. you should be able to search for it though.
#5
Text and other objects in a web page in IE are exposed as html elements. You can capture html elements with the Find Html Element dialog. In Firefox and Netscape, web page objects are exposed as accessible objects, and you can use the Find Accessible Element dialog instead.


Forum Jump:


Users browsing this thread: 1 Guest(s)