Example - Working with MS Excel:
using MSExcel = TcKs.MSOffice.Excel;
...
...
...
// The thread which communicate with MS Office must have a same culture as the MS Office.
// It's a well-know bug for several versions of MS Office.
// This bug is not in MS Office MUI.
// My language mutation of MS Office is "en-US".
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo( "en-US" );
using ( MSExcel.Application app = MSExcel.Application.CreateApplication() ) {
MSExcel.Workbook book1 = app.Workbooks.Open( this.txtOpen_FilePath.Text );
MSExcel.Worksheet sheet1 = (MSExcel.Worksheet)book1.Worksheets[1];
MSExcel.Range range_A1 = sheet1.GetRange( "A1" );
MSExcel.Range range_B2 = sheet1.GetRange( "B2" );
string message = "In cell 'A1' is '{0}' and in cell 'B2' is '{1}'.";
message = string.Format( message, range_A1.Value, range_B2.Value );
MessageBox.Show( message );
}
// Forced garbage collection. This is not necessary, but usefull.
TcKs.MSOffice.Common.WrapperHelper.GCCollect();