ListObjectExtensions.HasVstoObject Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HasVstoObject(ListObject, ApplicationFactory) |
Returns a value that indicates whether a ListObject host control has been created for the current ListObject object in an application-level add-in. Pass the Globals.Factory object in your project to the |
HasVstoObject(ListObject, Factory) |
Returns a value that indicates whether a ListObject host control has been created for the current ListObject object in a document-level customization. Pass the Globals.Factory object in your project to the |
HasVstoObject(ListObject, ApplicationFactory)
Returns a value that indicates whether a ListObject host control has been created for the current ListObject object in an application-level add-in. Pass the Globals.Factory object in your project to the factory
parameter.
public:
[System::Runtime::CompilerServices::Extension]
static bool HasVstoObject(Microsoft::Office::Interop::Excel::ListObject ^ listObject, Microsoft::Office::Tools::Excel::ApplicationFactory ^ factory);
public static bool HasVstoObject(this Microsoft.Office.Interop.Excel.ListObject listObject, Microsoft.Office.Tools.Excel.ApplicationFactory factory);
static member HasVstoObject : Microsoft.Office.Interop.Excel.ListObject * Microsoft.Office.Tools.Excel.ApplicationFactory -> bool
<Extension()>
Public Function HasVstoObject (listObject As ListObject, factory As ApplicationFactory) As Boolean
Parameters
- listObject
- ListObject
The native list object to test. Do not supply this parameter yourself. When you call this method on an Excel list object, the runtime supplies this parameter.
- factory
- ApplicationFactory
An object that provides access to certain features in your application-level add-in. Pass the Globals.Factory
object to this parameter.
Returns
true
if a ListObject host control has been created for the current ListObject object; otherwise, false
.
Remarks
In an application-level add-in, you can call this method to determine whether a Microsoft.Office.Tools.Excel.ListObject host control exists for any Microsoft.Office.Interop.Excel.ListObject object. Typically, you use this method to test for the existence of managed controls that you want to persist before closing or saving an Excel list object.
This method is provided for backward compatibility with Office projects that you retarget from the .NET Framework 3.5 to the .NET Framework 4 or the .NET Framework 4.5. In new projects that target the .NET Framework 4 or the .NET Framework 4.5, you should call the GetVstoObject
method that is provided by the Globals.Factory
object in your project. For more information, see Extending Word Documents and Excel Workbooks in VSTO Add-ins at Run Time.
Applies to
HasVstoObject(ListObject, Factory)
Returns a value that indicates whether a ListObject host control has been created for the current ListObject object in a document-level customization. Pass the Globals.Factory object in your project to the factory
parameter.
public:
[System::Runtime::CompilerServices::Extension]
static bool HasVstoObject(Microsoft::Office::Interop::Excel::ListObject ^ listObject, Microsoft::Office::Tools::Excel::Factory ^ factory);
public static bool HasVstoObject(this Microsoft.Office.Interop.Excel.ListObject listObject, Microsoft.Office.Tools.Excel.Factory factory);
static member HasVstoObject : Microsoft.Office.Interop.Excel.ListObject * Microsoft.Office.Tools.Excel.Factory -> bool
<Extension()>
Public Function HasVstoObject (listObject As ListObject, factory As Factory) As Boolean
Parameters
- listObject
- ListObject
The native list object to test. Do not supply this parameter yourself. When you call this method on an Excel list object, the runtime supplies this parameter.
- factory
- Factory
An object that provides access to certain features in your document-level customization. Pass the Globals.Factory
object to this parameter.
Returns
true
if a ListObject host control has been created for the current ListObject object; otherwise, false
.
Remarks
In a document-level customization, this method returns true
only if the Microsoft.Office.Interop.Excel.ListObject object on which you call this method is the underlying object of a Microsoft.Office.Tools.Excel.ListObject host control in the current customization. Otherwise, this method returns false
.
This method is provided for backward compatibility with Office projects that you retarget from the .NET Framework 3.5 to the .NET Framework 4 or the .NET Framework 4.5. In new projects that target the .NET Framework 4 or the .NET Framework 4.5, you should call the HasVstoObject
method that is provided by the Globals.Factory
object in your project. For more information, see Programming Document-Level Customizations.