Duplicates in outlook

Subject: Duplicates in outlook
From: "Chris Bayes" <Chris@xxxxxxxxxxx>
Date: Mon, 25 Sep 2000 17:00:58 -0400 (EST)
I wrote this javascript a while ago when my outlook routing went up the
spout and i was getting real duplicates in folders. It won't work in this
case because the "RecievedTime" is different and the body doesn't match
because of the footer but it might get you in the right direction (with
modification) if you want to clean up your list. Or you might prefer to do
it by hand.

save the following to a dup.js
execute as usual with
cscript dup.js
dup.js-----------------------------------------------------------------

// debugger;
var theApp = WScript.CreateObject("Outlook.Application");
var theNameSpace = theApp.GetNameSpace("MAPI");
theNameSpace.Logon( "profile", "password"); // (sic.)
var fd = theNameSpace.Folders(1); // change this to the pst index if you
need to
doFolder(fd);
function doFolder(fd){
 if ("xsl-list" == fd.name){
  var x=0;
  var i;
  for (i=1;i <= fd.Folders.count; i++){
   doFolder(fd.Folders(i));
  }
  var its = fd.items;
  if (its.Count > 1){
   its.sort("[ReceivedTime]", 2);
  }
  for (i=its.count; i > 1; i--){
   if (its(i).senderName == its(i-1).senderName
       && its(i).to == its(i-1).to
       && its(i).subject == its(i-1).subject
       && its(i).body == its(i-1).body             // bodies won't match try
id
       && its(i).body != ""){
    its(i).Delete();
    x++;
   }
  }
  WScript.Echo("Processed " + fd.name);
  WScript.Echo("Deleted items " + x);
 }
}

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread