The last time I faced a problem like this I found it simpler to write some small OriginC utility functions to delete the offending objects. The following functions did the trick for me
void DeleteNamedGraphObject(string strObjectName)
{
/*
Deletes graphobjects named "strGrOpjName" in all layers on the Active page
*/
Page Pg=Project.Pages();
if(Pg.IsValid()==true)
{
foreach (Layer Layr in Pg.Layers)
{
GraphObject grobj(Layr.GraphObjects(strObjectName));
{
if (grobj.IsValid()==true)
{
grobj.Destroy();
}
}
}
}
}
void DeleteNamedObjectType(string strObjType)
{
/*
Deletes named GraphbjectsTypes on all Layers of the Active page
*/
Page Pg=Project.Pages();
if(Pg.IsValid()==true)
{
foreach (Layer Layr in Pg.Layers)
{
foreach (GraphObject grobj in Layr.GraphObjects)
{
if(grobj.GetObjectType().CompareNoCase(strObjType)==0)
{
grobj.Destroy();
}
}
}
}
}