private void button1_Click(object sender, EventArgs e)
{
try
{
//Starting two different threads.
Thread SlideSelectThrd = new Thread(new
ThreadStart(SlideSelectionApp));
SlideSelectThrd.Start();
Thread SlideThrd = new Thread(new
ThreadStart(SlideSelectionApp1));
SlideThrd.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void SelectionOfSlideThrd(int n)
{
string sav = savppt + 0 + n;
objSp = new SlidePresentation();
//SelectSlide is Method in a another class which opens the ppt, copies
//the selected slide and pastes it in a new ppt. it takes 3 parameters :
//1) Ppt to copy slide from(input file name)
//2) New ppt to create from the slide that is copied(output file name)
//3) Where to paste in the new ppt(index)
//Input filename is Test0 and outputs are TesCopy00,TesCopy01,TesCopy02
objSp.SelectSlide(copppt + 0 + ".ppt",sav + ".ppt",1);
}
private void SelectionOfSlideThrd1(int n)
{
string sav = savppt + 1 + n;
objSp = new SlidePresentation();
objSp.SelectSlide(copppt + 1 + ".ppt",
sav + ".ppt",
1);
}
string copppt = "E:\\Test"; string savppt = "E:\\TestCopy";
private void SlideSelectionApp()
{
try
{
for (int n = 0; n < 3; n++)
{
SelectionOfSlideThrd(n);
}
}
catch (Exception ex){}
}
private void SlideSelectionApp1()
{
try
{
for (int n = 0; n < 3; n++)
{
SelectionOfSlideThrd1(n);
}
}
catch (Exception ex){}
}