A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Question often asked but not fully answered



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 8th 10, 06:00 PM posted to microsoft.public.outlook.program_addins
Martin Teefy
external usenet poster
 
Posts: 2
Default Question often asked but not fully answered

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  
Old February 8th 10, 07:40 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Question often asked but not fully answered

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 12:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.