Contents

# HasUnoInterfaces Function

測試 Basic Uno 物件是否支援某些 Uno 介面。

如果支援所有聲明的 Uno 介面，則傳回 True (真)，否則傳回 False (假)。

### Syntax:

HasUnoInterfaces( oTest, Uno-Interface-Name 1 [, Uno-Interface-Name 2, ...])

### Return type:

Bool

### Parameters:

Name | Type | Description
--- | --- | ---
oTest | Object | the Basic Uno object that you want to test.
Uno-Interface-Name 1, Uno-Interface-Name 2, ... | String | Uno interface name(s)

### Example:

    Sub HasInterface
        Dim bHas as Boolean
        Dim oSheet as Object
        oSheet = ThisComponent.Sheets(0)
        bHas = HasUnoInterfaces( oSheet, "com.sun.star.beans.XIntrospection" )
        Print bHas ' = True
    End Sub

相關主題

UNO Objects, Functions and Services

Please support us!