Him Manzoor,
Your question is a little open ended, and I'm not really sure what kind of PowerPoint values you are attempting to place into Excel, but you could certainly use Excel Automation to achieve your goal. For example, something like this:
void AutomateExcelExample()
{
Excel.Application excelApp = new Excel.Application();
excelApp.Visible = true;
Excel.Workbook workbook = excelApp.Workbooks.Add(Type.Missing);
Excel.Worksheet worksheet = (Excel.Worksheet)workbook.Worksheets[1];
Excel.Range range = worksheet.get_Range("A1", Type.Missing);
range.set_Value(Type.Missing, "Hello World");
MessageBox.Show("Intentional pause so you can see the result.");
// Cleanup:
GC.Collect();
GC.WaitForPendingFinalizers();
Marshal.FinalReleaseComObject(range);
Marshal.FinalReleaseComObject(worksheet);
workbook.Close(false, Type.Missing, Type.Missing);
Marshal.FinalReleaseComObject(workbook);
excelApp.Quit();
Marshal.FinalReleaseComObject(excelApp);
}
In the example above, the code opens a new Excel application instance, makes the application visible (which you probably do not want to do, but can be useful when testing), opens a new workbook, and then assigns the string value "Hello World" into the cell A1 of the first worksheet in the workbook.
I don't know what kind of PowerPoint data you are retrieving, but an Excel cell can handle most standard value types such as string, double, bool, DateTime, etc.
This solution will work both with or without VSTO, and will work for Excel versions 2007 and above as well as for Excel versions 2003 and below.
Does this help get you started?
Mike
Best Solution
Two things: 1) this is in VBA, but should be easily portable to C# and VSTO, 2) The "text changed" thing is a bit tricky. I can get you as far as "are you in a Title box" - the rest is more trival. It has to do with finding original state versus any changes. Probably doable, I just haven't done it.
To hook a selection change in PPT VBA, you'll need one class and one module. In the class, put this:
Name the class "clsPPTEvents". Then in any module, put the following:
Press F5 on the StartEvents and that will enable the hook. Press F5 on the EndEvents to disable it.