open outlook message

Started by RAK, December 20, 2013, 12:57:49 AM

Previous topic - Next topic

RAK

I have been trying for a couple of hours.. I have been able to create an outlook app object and display message info via ole in a wb message.

What I am looking to do, is locate specific messages by checking the subject line - when it meets the specific criteria; open it in a normal outlook email window, as if it were double-clicked by a user from the inbox.

thanks for any help..
Time to quit.. 4 am..

Deana

Give the following code a try:
Code (winbatch) Select

olFolderInbox = 6 ; constant DO NOT CHANGE
objOutlook = ObjectCreate ( "Outlook.Application" )
objNameSpace = objOutlook.GetNamespace( "MAPI" )
objFolder = objNameSpace.GetDefaultFolder( olFolderInbox ) ; access the Inbox
mycount = objFolder.Items.Count ; checks number of messages in inbox!
For ii = 1 to mycount
  objItem = objFolder.Items( ii ) ; single email
  strSubject = objItem.Subject    ; emails subject
  ret = AskYesNo( "Open Message with subject?", strSubject )
  If ret
      objItem.Display ; display email in Outlook
  Endif
  objItem = 0
Next
objFolder = 0
objNameSpace = 0
objOutlook = 0
exit



Reference: http://msdn.microsoft.com/en-us/library/office/ff861332.aspx

See also:
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/OLE~and~Outlook+Mark~Messages~as~Read~in~Outlook~using~OLE.txt
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/OLE~and~Outlook+Save~file~attachments~in~Outlook.txt
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/OLE~and~Outlook+Sort~Email~by~Received~Time.txt
Deana F.
Technical Support
Wilson WindowWare Inc.