Hi prasad,
Do this:
for(int i=1; i <= ppApp.Presentation.Count; i++)
{
if(ppApp.Presentations[i].Name == TargetFileName)
{
ppApp.Presentations[i].Windows[i].Activate();
}
}
If you want to use the foreach only, then use an integer i;
int i = 0;
foreach (PPT.Presentation pp in ppApp.Presentations)
{
i = i + 1;
if (pp.Name == TargetFileName)
{
pp.Windows(i).Activate();
}
}
Hope it helped. :)