error here if (oSentFolder.Items[i].conI
saying
'object' does not contain a definition for 'conIndex'
thanks
Main Topics
Browse All TopicsHi experts,
This seems to be dragging on. this is the last installment of my outlook programming.
Trying to write a piece of code to evaluate if an outlook msg which is in the sentbox has been replied to or not.
the best way is to loop through each item in the folder and determine if the first index is greater than the second index.
if it is then the search stops, else it continues until it finds out that it something.
so far this is what i have
my code doeasn't work because i can't figure somethings out!!
Any assistance will be greatly appreciated.
thanks
private static void hasBeenReplied(MailItem msg)
{
string conIndex = msg;
msg.ConversationIndex;
bool retval =false;
//look for the conversation index in sent items
for (int i=0; i<=oSentFolder.Items.Count
{
if (oSentFolder.Items[i].conI
{
retval = true;
}
return retval
}
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
private bool hasBeenReplied(MailItem msg)
{
string conIndex = msg;
msg.ConversationIndex;
bool retval =false;
//look for the conversation index in sent items
for (int i=0; i<oSentFolder.Items.Count ; i++)
{
if (oSentFolder.Items[i].conI
{
retval = true;
break;
}
return retval; //if you want to return anything then have the return value as bool instead of void
}
}
private bool hasBeenReplied(MailItem msg)
{
string conIndex = msg.ConversationIndex;
bool retval =false;
//look for the conversation index in sent items
for (int i=0; i<oSentFolder.Items.Count ; i++)
{
if (oSentFolder.Items[i].Conv
{
retval = true;
break;
}
return retval; //if you want to return anything then have the return value as bool instead of void
}
}
see this
http://msdn.microsoft.com/
Also the version of the outlook you are using may not support this property.
After this, you may also need to use the ConversationTopic to see if the message is replied.
cheers
sorry about the delay:::::::
private static bool hasBeenReplied(MailItem msg)
{
string conIndex = msg.ConversationIndex;
bool retval =false;
//look for the conversation index in sent items
for (int i=0; i<oSentFolder.Items.Count ; i++)
{
if (oSentFolder.Items[i].Conv
{
retval = true;
break;
}
return retval;
}
}
full code======================
using System;
using Microsoft.Office.Interop.O
using System.Collections;
using System.Reflection;
namespace EmailSorter
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Test
{
/// <summary>
/// The main entry point for the application.
/// </summary>
private static Application oApp;
private static NameSpace oNS;
private static Recipient oUser;
private static MAPIFolder oFolder;
private static MAPIFolder oReadNotActionedDestinatio
private static MAPIFolder oReadDestinationFolder;
private static MAPIFolder oSentFolder;
private static MAPIFolder oInboxFolder;
private static MAPIFolder oFileToJunk;
[STAThread]
static void Main(string[] args)
{
// oNS.Logon("Azunma, Chi",Missing.Value,false,t
Console.WriteLine("KPMG outlook inbox manager");
Console.WriteLine(" In progress");
Console.WriteLine(" Loading outlook folders");
inistialiseFolders();
//MailItem oMsg = (MailItem)oItems.GetFirst(
int iCount = 0;
int iNewCount = 1;
Console.WriteLine(" Processing mail items");
while (iCount != iNewCount)
{
Items oItems = oFolder.Items;
iCount = oItems.Count;
for (int i=1; i<=iCount; i++)
{
try
{
MailItem oMsg = (MailItem)oItems[i];
//string test = oMsg.CC;
// string index = oMsg.ConversationIndex;
//string topic =oMsg.ConversationTopic;
Console.WriteLine(" Mail item: " + oMsg.Subject);
if (!oMsg.UnRead)
{
if(inCCField(oMsg))
{
oMsg.Move(oFileToJunk);
Console.WriteLine(" checking the CC Field");
Console.WriteLine(" moved to junk folder");
}
else
{
if (HasBeenReplied(oMsg.Subje
{
if(hasAttachment(oMsg))
{
oMsg.Move(oFileToJunk);
Console.WriteLine(" checking the Attachment PlaceHolder");
Console.WriteLine(" moved to junk folder");
}
else
{
oMsg.Move(oInboxFolder);
Console.WriteLine(" moved to Deleted Items");
}
}
else
{
oMsg.Move(oFileToJunk);
Console.WriteLine(" moved to junk folder");
}
}
}
}
// if (!oMsg.UnRead && hasBeenActioned(oMsg.Subje
// {
// oMsg.Move(oReadDestination
// Console.WriteLine(" moved to junk folder");
// }
//
//
// if (!oMsg.UnRead && hasAttachment(oMsg))
// {
// oMsg.Move(oInboxFolder);
// Console.WriteLine(" moved to Deleted Test junk folder");
// }
//
//
// if (!oMsg.UnRead)
// {
// oMsg.Move(oReadNotActioned
// Console.WriteLine(" task created");
// }
// else
// {
// Console.WriteLine(" not touched");
// }
//
// }
//
catch (System.InvalidCastExcepti
{
Console.WriteLine(" Not an item of mail");
}
catch {}
}
iNewCount = oItems.Count;
}
Console.WriteLine("Complet
Console.WriteLine("Press enter to exit application");
Console.Read();
}
private static bool hasBeenActioned (string mailSubject)
{
bool retval = false;
for (int i=1; i<=oSentFolder.Items.Count
{
try
{
MailItem msg = (MailItem)oSentFolder.Item
if (msg.Subject == mailSubject)
{
retval = true;
}
}
catch{}
}
return retval;
}
//Code to see if email has an attachment.
private static bool hasAttachment (MailItem msg)
{
bool retval = false;
{
try
{
if (msg.Attachments.Count > 0)
{
retval = true;
}
}
catch{}
}
return retval;
}
private static bool inCCField (MailItem CCmsg)
{
bool retval = false;
{
try
{
if (CCmsg.CC != null)
{
retval = true;
}
}
catch{}
}
return retval;
}
// private static bool HasBeenReplied (MailItem RepliedMsg)
// {
// bool retval = false;
// try
// {
//
// string s = "h";
// s=s.Substring(
// foreach (MailItem Repliedmsg )
// {
// int convIndex = int.Parse(Repliedmsg.Conve
// if (convIndex > 0)
// {
// retval = true;
// }
// }
// }
// catch (System.InvalidCastExcepti
// {
// Console.WriteLine(exc.Mess
// }
// return retval;
// }
//
//
//
// private static void hasBeenReplied(MailItem msg)
// {
// string conIndex = msg.ConversationIndex;
// bool retval =false;
// //look for the conversation index in sent items
// for (int i=0; i<=oSentFolder.Items.Count
// {
// if (oSentFolder.Items[i].conI
//
//
//
// {
// retval = true;
// }
// return retval;
// }
// }
//
private static bool hasBeenReplied(MailItem msg)
{
string conIndex = msg.ConversationIndex;
bool retval =false;
//look for the conversation index in sent items
for (int i=0; i<oSentFolder.Items.Count ; i++)
{
if (oSentFolder.Items[i].Conv
{
retval = true;
break;
}
return retval;
}
}
private static void inistialiseFolders()
{
oApp = new ApplicationClass();
oNS = oApp.GetNamespace("MAPI");
oUser = oNS.CreateRecipient("Azunm
oFolder = oNS.GetSharedDefaultFolder
oReadNotActionedDestinatio
oReadDestinationFolder = oNS.GetSharedDefaultFolder
oSentFolder = oNS.GetDefaultFolder(OlDef
oInboxFolder = oNS.GetDefaultFolder(OlDef
oFileToJunk = oNS.GetSharedDefaultFolder
}
}
}
during compilation
i got this error
'object' does not contain a definition for 'ConversationIndex'
this code
private static bool hasBeenReplied(MailItem msg)
{
string conIndex = msg.ConversationIndex;
bool retval =false;
//look for the conversation index in sent items
for (int i=0; i<oSentFolder.Items.Count ; i++)
{
if (oSentFolder.Items[i].Conv
{
retval = true;
break;
}
return retval;
}
}
thanks
which line does the error come up?
string conIndex = msg.ConversationIndex;
OR
if (oSentFolder.Items[i].Conv
I have donesome changes - try them out
It may be that the vesion of the Outlook does not support this property:
private static bool hasBeenReplied(MailItem msg)
{
string conIndex = msg.ConversationIndex;
string conTopic = msg.ConversationTopic;
bool retval =false;
//look for the conversation index in sent items
for (int i=0; i<oSentFolder.Items.Count ; i++)
{
if ((oSentFolder.Items[i].Con
(Convert.ToInt64(oSentFold
{
retval = true;
break;
}
}
return retval;
}
hi tried it, the version of outlook is 2003.
am using this com library.
using Microsoft.Office.Interop.O
==========================
i still have this error { 'object' does not contain a definition for 'ConversationTopic'}
this is being highlighted
if ((oSentFolder.Items[i].Con
private static bool hasBeenReplied(MailItem msg)
{
string conIndex = msg.ConversationIndex;
string conTopic = msg.ConversationTopic;
bool retval =false;
//look for the conversation index in sent items
for (int i=0; i<oSentFolder.Items.Count ; i++)
{
if ((oSentFolder.Items[i].Con
(Convert.ToInt64(oSentFold
{
retval = true;
break;
}
}
return retval;
}
thanks
Can you give a last try.
private static bool hasBeenReplied(MailItem msg)
{
string conIndex = msg.ConversationIndex;
string conTopic = msg.ConversationTopic;
bool retval =false;
//look for the conversation index in sent items
for (int i=0; i<oSentFolder.Items.Count ; i++)
{
MailItem oSentMailItem = oSentFolder.Items[i];
MessageBox.Show(oSentMailI
if ((oSentMailItem .ConversationTopic == conTopic ) &&
(Convert.ToInt64(oSentMail
{
retval = true;
break;
}
}
return retval;
}
done it and thanks for your help.
Your based in london am here as well. Damn the weather a smashed!!!
private static bool hasBeenReplied(MailItem msg)
{
string conIndex = msg.ConversationIndex;
string conTopic = msg.ConversationTopic;
bool retval =false;
//look for the conversation index in sent items
for (int i=1; i<=oSentFolder.Items.Count
{
try
{
MailItem sentMailItem = (MailItem)oSentFolder.Item
string sentConIndex = sentMailItem.ConversationI
if (sentConIndex.Length > conIndex.Length)
{
string sCompare = sentConIndex.Substring(0,c
if (sCompare == conIndex )
{
retval = true;
break;
}
}
}
catch {} //i's not an item of mail - ignore the error
}
return retval;
}
Business Accounts
Answer for Membership
by: SirReadAlotPosted on 2005-08-24 at 03:26:31ID: 14741054
sorry this
&& retval==false; i++) ndex== conIndex)
private static void hasBeenReplied(MailItem msg)
{
string conIndex = msg;
msg.ConversationIndex;
bool retval =false;
//look for the conversation index in sent items
for (int i=0; i<=oSentFolder.Items.Count
{
if (oSentFolder.Items[i].conI
{
retval = true;
}
return retval;
}
}