FindItems

Applies To:

Images collection

Description:

Determines a group of images with the same name in the Resource Manager. The return value of this methods is a pseudo-array containing all images in the Resource Manager with display name equal to selected. The first item in the array is at ordinal 1.

Example

This example shows how to find a group of images with the same name in the Resource Manager. The return value is captured by the Count property and displayed in a text box.

//Clear all TextBoxes except TextBox5
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""

var ActionName = "RM FindItems()"

TextBox1.Text ="Start " + ActionName 

strDisplayName = TextBox5.Text

if (TextBox5.Text == "")
{

try
{

arrFindRM= ActiveDocument.ResourceManager.Images.FindItems("Waves")
//arrFindRM= ActiveDocument.ResourceManager.Images.FindItems("")

TextBox3.Text = "Count for this image is: " + arrFindRM.Count

ActiveSection.Shapes["ListBox2"].RemoveAll()

for (i = 1; i <= arrFindRM.Count; i++)
{
Console.Writeln(arrFindRM[i].Name)
ActiveSection.Shapes["ListBox2"].Add(arrFindRM[i].Name)
} //end for

} //end try
catch(e)
{
TextBox2.Text = "Caught: " + e.toString()
}//end catch

} //end if
else
{

try
{
arrFindRM= ActiveDocument.ResourceManager.Images.FindItems(TextBox5.Text)

TextBox3.Text = "Count for this image is: " + arrFindRM.Count

ActiveSection.Shapes["ListBox2"].RemoveAll()

for (i = 1; i <= arrFindRM.Count; i++)
{
Console.Writeln(arrFindRM[i].Name)
ActiveSection.Shapes["ListBox2"].Add(arrFindRM[i].Name)
} //end for

} //end try
catch(e)
{
TextBox2.Text = "Caught: " + e.toString()
}//end catch


}

TextBox1.Text ="End " + ActionName