This project has moved and is read-only. For the latest updates, please go here.
/* taken from Tutorial08.csproj
   Any object in NetOffice implements a special method too see at runtime a specified property or method is available
This very important because not any property or method is available in any office version bool EntityIsAvailable(string name); bool EntityIsAvailable(string name, SupportEntityType searchType); This example shows you how to use. See chapter8 in technical documentation for further info. */
void Foo() { // Initialize NetOffices LateBindingApi.Core.Factory.Initialize(); // create new instance Excel.Application application = new Excel.Application(); // check for support at runtime bool enableLivePreviewSupport = application.EntityIsAvailable("EnableLivePreview"); bool openDatabaseSupport = application.Workbooks.EntityIsAvailable("OpenDatabase"); string result = "Excel Runtime Check: " + Environment.NewLine; result += "Support EnableLivePreview: " + enableLivePreviewSupport.ToString() + Environment.NewLine; result += "Support OpenDatabase: " + openDatabaseSupport.ToString() + Environment.NewLine; richTextBoxResult.Text = result; // quit and dispose application.Quit(); application.Dispose(); }

Last edited Nov 13, 2011 at 11:54 PM by SebastianDotNet, version 8


No comments yet.