![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hi,
I'm using a free com dll from MAPILab in VB6 to get the extended properties of emails bypassing the outlook warning message but i'm having trouble getting the read/unread/replied status As I said a frequent question but there doesn't seem to be a good answer as i've spent all afternoon reading the answers/questions to build up the following code but i'm obviously missing something... Code is: Private Const cdoPR_ICON_INDEX As Long = &H10800003 Private Const cdoPR_LAST_VERB_EXECUTED As Long = &H10810003 Private Const cdoPR_LAST_VERB_EXECUTION_TIME As Long = &H10820040 Private Const EXCHIVERB_REPLYTOSENDER = 102 Private Const EXCHIVERB_REPLYTOALL = 103 Private Const EXCHIVERB_FORWARD = 104 Set objProps = CreateObject("Mapiprop.MAPIPropWrapper") objProps.Initialize Set olApp = New Outlook.Application Set olNameSpace = olApp.GetNamespace("MAPI") Set olFolder = olNameSpace.GetDefaultFolder(olFolderInbox) Set objItem = olFolder.Items.GetLast ' GetFirst ' PR_SENDER_NAME + PR_SENDER_EMAIL_ADDRESS from_text.Text = objProps.getoneprop(objItem, CdoPR_SENDER_NAME) + " " + objProps.getoneprop(objItem, CdoPR_SENDER_EMAIL_ADDRESS) + "" size_text.Text = objProps.getoneprop(objItem, CdoPR_MESSAGE_SIZE) subject_text.Text = objProps.getoneprop(objItem, CdoPR_SUBJECT) sent_text.Text = objProps.getoneprop(objItem, CdoPR_MESSAGE_DELIVERY_TIME) If IsDate(objProps.getoneprop(objItem, CdoPR_LAST_MODIFICATION_TIME)) Then Select Case IIf(IsEmpty(objProps.getoneprop(objItem, cdoPR_LAST_VERB_EXECUTED)), 101, objProps.getoneprop(objItem, cdoPR_LAST_VERB_EXECUTED)) Case 101 .CellDetails iRow, 1, , , 4 ' Read Icon Case 102 ' Replied to .CellDetails iRow, 1, , , 3 ' Reply Icon Case 103 ' Replied to All .CellDetails iRow, 1, , , 3 ' Reply Icon Case 104 ' Forwarded to .CellDetails iRow, 1, , , 2 ' Forward Icon Case Else .CellDetails iRow, 1, , , 1 ' Unread End Select End If but the objProps.getoneprop(objItem, cdoPR_LAST_VERB_EXECUTED) step always give an automation error am I missing something? Any advice appreciated. Thanks Martin |
#2
|
|||
|
|||
![]()
One thing you might be missing is that the property in question is not going
to be present on every item. Only items that have had an action executed on them will have that property. Your code must handle the error that will occur if it tries to access a property that is not present. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Martin Teefy" martin[dot]teefy[at]crosscompass[dot]com wrote in message ... Hi, I'm using a free com dll from MAPILab in VB6 to get the extended properties of emails bypassing the outlook warning message but i'm having trouble getting the read/unread/replied status As I said a frequent question but there doesn't seem to be a good answer as i've spent all afternoon reading the answers/questions to build up the following code but i'm obviously missing something... Code is: Private Const cdoPR_ICON_INDEX As Long = &H10800003 Private Const cdoPR_LAST_VERB_EXECUTED As Long = &H10810003 Private Const cdoPR_LAST_VERB_EXECUTION_TIME As Long = &H10820040 Private Const EXCHIVERB_REPLYTOSENDER = 102 Private Const EXCHIVERB_REPLYTOALL = 103 Private Const EXCHIVERB_FORWARD = 104 Set objProps = CreateObject("Mapiprop.MAPIPropWrapper") objProps.Initialize Set olApp = New Outlook.Application Set olNameSpace = olApp.GetNamespace("MAPI") Set olFolder = olNameSpace.GetDefaultFolder(olFolderInbox) Set objItem = olFolder.Items.GetLast ' GetFirst ' PR_SENDER_NAME + PR_SENDER_EMAIL_ADDRESS from_text.Text = objProps.getoneprop(objItem, CdoPR_SENDER_NAME) + " " + objProps.getoneprop(objItem, CdoPR_SENDER_EMAIL_ADDRESS) + "" size_text.Text = objProps.getoneprop(objItem, CdoPR_MESSAGE_SIZE) subject_text.Text = objProps.getoneprop(objItem, CdoPR_SUBJECT) sent_text.Text = objProps.getoneprop(objItem, CdoPR_MESSAGE_DELIVERY_TIME) If IsDate(objProps.getoneprop(objItem, CdoPR_LAST_MODIFICATION_TIME)) Then Select Case IIf(IsEmpty(objProps.getoneprop(objItem, cdoPR_LAST_VERB_EXECUTED)), 101, objProps.getoneprop(objItem, cdoPR_LAST_VERB_EXECUTED)) Case 101 .CellDetails iRow, 1, , , 4 ' Read Icon Case 102 ' Replied to .CellDetails iRow, 1, , , 3 ' Reply Icon Case 103 ' Replied to All .CellDetails iRow, 1, , , 3 ' Reply Icon Case 104 ' Forwarded to .CellDetails iRow, 1, , , 2 ' Forward Icon Case Else .CellDetails iRow, 1, , , 1 ' Unread End Select End If but the objProps.getoneprop(objItem, cdoPR_LAST_VERB_EXECUTED) step always give an automation error am I missing something? Any advice appreciated. Thanks Martin Submitted using http://www.outlookforums.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Asked before cannot find question or answer anymore "Caracter mess | alpine | Outlook - General Queries | 2 | October 2nd 09 03:48 PM |
create a question that can be answered in the same text in outlook | Mark | Outlook - General Queries | 3 | April 18th 07 04:22 AM |
How do I lookup a previously asked question to see answers? | George P. | Outlook - Using Contacts | 1 | September 29th 06 12:56 AM |
I need a simple question answered.. | Roxi | Outlook Express | 5 | July 10th 06 04:12 AM |
Received e-mail my question was answered, can't find it. ADVISE | theborg99 | Outlook - Using Forms | 0 | March 20th 06 06:09 PM |