Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using MS Outlook - Incoming Email Monitoring
#1
Greetings,

Kindly advise how do I monitor the incoming emails from MS Outlook client.
I need to look for specific words like(reservation, amendment, discount, booking, stock, etc) in both the subject and message to determine certain sales order emails.
The mail needs to be pulled up and the contents flashed on a userform.

How do I go about this?

I did search another solved topic in this regards.
I have also downloaded the 'outlook inbox trigger.qml' and imported it to QM.
However, I still can't get my head around it on how to implement it to my needs stated above.

Thanks,
Philip
Best Regards,
Philip
#2
Run Outlook, then run this function. It catches new messages in Outlook Inbox.

Function outlook_inbox_trigger
Code:
Copy      Help
;/exe 1
typelib Outlook {00062FFF-0000-0000-C000-000000000046} 9.2

Outlook.Application a._getactive
Outlook.NameSpace ns=a.Session
Outlook.Items items=ns.GetDefaultFolder(olFolderInbox).Items
items._setevents("sub.items")

;wait until outlook exits
a._setevents("sub.a")
opt waitmsg 1
int- t_quit
rep() 1; if(t_quit) break


#sub a_Quit
function ;;Outlook._Application'a

out "outlook quit"

int- t_quit
t_quit=1


#sub items_ItemAdd
function IDispatch'Item ;;Outlook._Items'items

out "outlook item added"
sub.NewMessageInInbox Item


#sub NewMessageInInbox
function Outlook.MailItem'mi

;note: here Outlook shows a security warning message box

str email=mi.SenderEmailAddress
out email
str subject=mi.Subject
out subject
;out mi.BodyFormat
str s=mi.Body
out s

;now extract words from s and subject...

err+ out _error.description
Or use QM POP3 email functions, if possible.


Forum Jump:


Users browsing this thread: 1 Guest(s)