OpenOffice/LibreOffice BasicのThisComponentオブジェクトの使い方を解説します。
ThisComponentの属性一覧を次に示す。
属性 | 概要 | |
---|---|---|
SbxBOOL | ApplyFormDesignMode | |
SbxOBJECT | AreaLinks | |
SbxBOOL | AutomaticControlFocus | |
SbxOBJECT | BasicLibraries | |
SbxOBJECT | DialogLibraries | |
SbxBOOL | CalcAsShown | |
SbxOBJECT | CharLocale | |
SbxOBJECT | CharLocaleAsian | |
SbxOBJECT | CharLocaleComplex | |
SbxOBJECT | ColumnLabelRanges | |
SbxOBJECT | DDELinks | |
SbxINTEGER | DefaultTabStop | |
SbxOBJECT | ForbiddenCharacters | |
SbxBOOL | HasDrawPages | |
SbxBOOL | IgnoreCase | |
SbxBOOL | IsIterationEnabled | |
SbxLONG | IterationCount | |
SbxDOUBLE | IterationEpsilon | |
SbxBOOL | LookUpLabels | |
SbxBOOL | MatchWholeCell | |
SbxOBJECT | NamedRanges | |
SbxOBJECT | DatabaseRanges | |
SbxOBJECT | NullDate | |
SbxOBJECT | RowLabelRanges | |
SbxOBJECT | SheetLinks | |
SbxBOOL | SpellOnline | |
SbxINTEGER | StandardDecimals | |
SbxBOOL | RegularExpressions | |
SbxSTRING | RuntimeUID | |
SbxBOOL | HasValidSignatures | |
SbxSTRING | BuildId | |
SbxSTRING | Identifier | |
SbxSTRING | URL | |
SbxARRAY | Args | |
SbxOBJECT | CurrentController | |
SbxOBJECT | CurrentSelection | 現在選択されているオブジェクト |
SbxOBJECT | Controllers | |
SbxARRAY | AvailableViewControllerNames | |
SbxBOOL | AllowMacroExecution | |
SbxOBJECT | ViewData | |
SbxARRAY | TransferDataFlavors | |
SbxOBJECT | Events | |
SbxOBJECT | UIConfigurationManager | |
SbxARRAY | DocumentSubStoragesNames | |
SbxOBJECT | DocumentStorage | |
SbxOBJECT | ScriptProvider | |
SbxARRAY | Types | |
SbxARRAY | ImplementationId | |
SbxOBJECT | Parent | |
SbxOBJECT | DocumentInfo | |
SbxBOOL | Modified | |
SbxARRAY | Printer | |
SbxSTRING | Location | |
SbxOBJECT | LibraryContainer | |
SbxOBJECT | Sheets | ScTableSheetsObj |
SbxINTEGER | ActionLocks | |
SbxOBJECT | DrawPages | |
SbxOBJECT | StyleFamilies | |
SbxOBJECT | Links | |
SbxOBJECT | PropertySetInfo | |
SbxARRAY | AvailableServiceNames | |
SbxSTRING | ImplementationName | |
SbxARRAY | SupportedServiceNames | |
SbxOBJECT | NumberFormatSettings | |
SbxOBJECT | NumberFormats | |
SbxOBJECT | Delegator | |
SbxSTRING | Dbg_SupportedInterfaces | サポートしているインタフェースの一覧 |
SbxSTRING | Dbg_Properties | 属性の一覧 |
SbxSTRING | Dbg_Methods | メソッドの一覧 |
ThisComponentのメソッド一覧を次に示す。
メソッド | 概要 | |
---|---|---|
SbxEMPTY | queryInterface ( SbxOBJECT ) | インタフェースの問い合わせ |
SbxVOID | setIdentifier ( SbxSTRING ) | |
SbxSTRING | getIdentifier ( void ) | |
SbxVOID | dispose ( void ) | |
SbxVOID | addEventListener ( SbxOBJECT ) | |
SbxVOID | removeEventListener ( SbxOBJECT ) | |
SbxBOOL | attachResource ( SbxSTRING, SbxARRAY ) | |
SbxSTRING | getURL ( void ) | |
SbxARRAY | getArgs ( void ) | |
SbxVOID | connectController ( SbxOBJECT ) | |
SbxVOID | disconnectController ( SbxOBJECT ) | |
SbxVOID | lockControllers ( void ) | |
SbxVOID | unlockControllers ( void ) | |
SbxBOOL | hasControllersLocked ( void ) | |
SbxOBJECT | getCurrentController ( void ) | |
SbxVOID | setCurrentController ( SbxOBJECT ) | |
SbxOBJECT | getCurrentSelection ( void ) | |
SbxOBJECT | getControllers ( void ) | |
SbxARRAY | getAvailableViewControllerNames ( void ) | |
SbxOBJECT | createDefaultViewController ( SbxOBJECT, SbxOBJECT ) | |
SbxOBJECT | createViewController ( SbxSTRING, SbxARRAY, SbxOBJECT, SbxOBJECT ) | |
SbxOBJECT | getViewData ( void ) | |
SbxVOID | setViewData ( SbxOBJECT ) | |
SbxEMPTY | getTransferData ( SbxOBJECT ) | |
SbxARRAY | getTransferDataFlavors ( void ) | |
SbxBOOL | isDataFlavorSupported ( SbxOBJECT ) | |
SbxVOID | addPrintJobListener ( SbxOBJECT ) | |
SbxVOID | removePrintJobListener ( SbxOBJECT ) | |
SbxOBJECT | getEvents ( void ) | |
SbxVOID | setVisualAreaSize ( SbxINT64, SbxOBJECT ) | |
SbxOBJECT | getVisualAreaSize ( SbxINT64 ) | |
SbxOBJECT | getPreferredVisualRepresentation ( SbxINT64 ) | |
SbxLONG | getMapUnit ( SbxINT64 ) | |
SbxINT64 | getSomething ( SbxARRAY ) | |
SbxOBJECT | getUIConfigurationManager ( void ) | |
SbxOBJECT | getDocumentSubStorage ( SbxSTRING, SbxLONG ) | |
SbxARRAY | getDocumentSubStoragesNames ( void ) | |
SbxVOID | loadFromStorage ( SbxOBJECT, SbxARRAY ) | |
SbxVOID | storeToStorage ( SbxOBJECT, SbxARRAY ) | |
SbxVOID | switchToStorage ( SbxOBJECT ) | |
SbxOBJECT | getDocumentStorage ( void ) | |
SbxVOID | addStorageChangeListener ( SbxOBJECT ) | |
SbxVOID | removeStorageChangeListener ( SbxOBJECT ) | |
SbxOBJECT | getScriptProvider ( void ) | |
SbxVOID | addCloseListener ( SbxOBJECT ) | |
SbxVOID | removeCloseListener ( SbxOBJECT ) | |
SbxARRAY | getTypes ( void ) | |
SbxARRAY | getImplementationId ( void ) | |
SbxOBJECT | getParent ( void ) | |
SbxVOID | setParent ( SbxOBJECT ) | |
SbxOBJECT | getDocumentInfo ( void ) | |
SbxVOID | disposing ( SbxOBJECT ) | |
SbxVOID | addModifyListener ( SbxOBJECT ) | |
SbxVOID | removeModifyListener ( SbxOBJECT ) | |
SbxBOOL | isModified ( void ) | |
SbxVOID | setModified ( SbxBOOL ) | |
SbxBOOL | disableSetModified ( void ) | |
SbxBOOL | enableSetModified ( void ) | |
SbxBOOL | isSetModifiedEnabled ( void ) | |
SbxARRAY | getPrinter ( void ) | |
SbxVOID | setPrinter ( SbxARRAY ) | |
SbxVOID | print ( SbxARRAY ) | |
SbxBOOL | hasLocation ( void ) | |
SbxSTRING | getLocation ( void ) | |
SbxBOOL | isReadonly ( void ) | |
SbxVOID | store ( void ) | |
SbxVOID | storeAsURL ( SbxSTRING, SbxARRAY ) | |
SbxVOID | storeToURL ( SbxSTRING, SbxARRAY ) | |
SbxVOID | storeSelf ( SbxARRAY ) | |
SbxVOID | initNew ( void ) | |
SbxVOID | load ( SbxARRAY ) | |
SbxVOID | close ( SbxBOOL ) | |
SbxOBJECT | getLibraryContainer ( void ) | |
SbxVOID | createLibrary ( SbxSTRING, SbxSTRING, SbxSTRING, SbxSTRING ) | |
SbxVOID | addModule ( SbxSTRING, SbxSTRING, SbxSTRING, SbxSTRING ) | |
SbxVOID | addDialog ( SbxSTRING, SbxSTRING, SbxARRAY ) | |
SbxVOID | addEventListener ( SbxOBJECT ) | |
SbxVOID | removeEventListener ( SbxOBJECT ) | |
SbxOBJECT | getSheets ( void ) | |
SbxBOOL | isActionLocked ( void ) | 画面表示の更新が抑制されているか否かを判定 |
SbxVOID | addActionLock ( void ) | 画面描画更新の抑制 |
SbxVOID | removeActionLock ( void ) | 画面描画更新抑制の解除 |
SbxVOID | setActionLocks ( SbxINTEGER ) | |
SbxINTEGER | resetActionLocks ( void ) | |
SbxVOID | calculate ( void ) | |
SbxVOID | calculateAll ( void ) | |
SbxBOOL | isAutomaticCalculationEnabled ( void ) | |
SbxVOID | enableAutomaticCalculation ( SbxBOOL ) | |
SbxVOID | protect ( SbxSTRING ) | |
SbxVOID | unprotect ( SbxSTRING ) | |
SbxBOOL | isProtected ( void ) | |
SbxOBJECT | getDrawPages ( void ) | |
SbxOBJECT | seekGoal ( SbxOBJECT, SbxOBJECT, SbxSTRING ) | |
SbxOBJECT | createConsolidationDescriptor ( SbxBOOL ) | |
SbxVOID | consolidate ( SbxOBJECT ) | |
SbxVOID | refreshArrows ( void ) | |
SbxOBJECT | getStyleFamilies ( void ) | |
SbxLONG | getRendererCount ( SbxVARIANT, SbxARRAY ) | |
SbxARRAY | getRenderer ( SbxLONG, SbxVARIANT, SbxARRAY ) | |
SbxVOID | render ( SbxLONG, SbxVARIANT, SbxARRAY ) | |
SbxOBJECT | getLinks ( void ) | |
SbxOBJECT | getPropertySetInfo ( void ) | |
SbxVOID | setPropertyValue ( SbxSTRING, SbxVARIANT ) | |
SbxEMPTY | getPropertyValue ( SbxSTRING ) | |
SbxVOID | addPropertyChangeListener ( SbxSTRING, SbxOBJECT ) | |
SbxVOID | removePropertyChangeListener ( SbxSTRING, SbxOBJECT ) | |
SbxVOID | addVetoableChangeListener ( SbxSTRING, SbxOBJECT ) | |
SbxVOID | removeVetoableChangeListener ( SbxSTRING, SbxOBJECT ) | |
SbxOBJECT | createInstance ( SbxSTRING ) | |
SbxOBJECT | createInstanceWithArguments ( SbxSTRING, SbxARRAY ) | |
SbxARRAY | getAvailableServiceNames ( void ) | |
SbxSTRING | getImplementationName ( void ) | |
SbxBOOL | supportsService ( SbxSTRING ) | |
SbxARRAY | getSupportedServiceNames ( void ) | |
SbxOBJECT | getNumberFormatSettings ( void ) | |
SbxOBJECT | getNumberFormats ( void ) | |
SbxOBJECT | queryAdapter ( void ) | |
SbxVOID | setDelegator ( SbxOBJECT ) | |
SbxEMPTY | queryAggregation ( SbxOBJECT ) |
現在選択されているオブジェクト。例えば、OpenOffice.org Calcで単一のセルが選択されている場合はScCellObj、複数のセル(セル範囲)が指定されている場合はScCellRangeObj。
Dim oSelect As Object
oSelect = ThisComponent.CurrentSelection
Dim Sheets As Ojbect
シートオブジェクト(ScTableSheetsObj)
サポートしているインタフェースの一覧
OpenOffice.org 3 の場合、ThisComponent は次のインタフェースをサポートしている。
Supported interfaces by object "ThisComponent":
com.sun.star.container.XChild
com.sun.star.document.XDocumentInfoSupplier
com.sun.star.document.XDocumentPropertiesSupplier
com.sun.star.document.XEventBroadcaster
com.sun.star.lang.XEventListener
com.sun.star.document.XEventsSupplier
com.sun.star.document.XEmbeddedScripts
com.sun.star.document.XScriptInvocationContext
com.sun.star.frame.XModel2
com.sun.star.frame.XModel
com.sun.star.lang.XComponent
com.sun.star.util.XModifiable2
com.sun.star.util.XModifiable
com.sun.star.util.XModifyBroadcaster
com.sun.star.view.XPrintable
com.sun.star.view.XPrintJobBroadcaster
com.sun.star.frame.XStorable2
com.sun.star.frame.XStorable
com.sun.star.frame.XLoadable
com.sun.star.script.XStarBasicAccess
com.sun.star.document.XViewDataSupplier
com.sun.star.util.XCloseable
com.sun.star.util.XCloseBroadcaster
com.sun.star.datatransfer.XTransferable
com.sun.star.document.XDocumentSubStorageSupplier
com.sun.star.document.XStorageBasedDocument
com.sun.star.script.provider.XScriptProviderSupplier
com.sun.star.ui.XUIConfigurationManagerSupplier
com.sun.star.embed.XVisualObject
com.sun.star.lang.XUnoTunnel
com.sun.star.frame.XModule
com.sun.star.frame.XTitle
com.sun.star.frame.XTitleChangeBroadcaster
com.sun.star.frame.XUntitledNumbers
com.sun.star.lang.XTypeProvider
com.sun.star.uno.XWeak
com.sun.star.sheet.XSpreadsheetDocument
com.sun.star.document.XActionLockable
com.sun.star.sheet.XCalculatable
com.sun.star.util.XProtectable
com.sun.star.drawing.XDrawPagesSupplier
com.sun.star.sheet.XGoalSeek
com.sun.star.sheet.XConsolidatable
com.sun.star.sheet.XDocumentAuditing
com.sun.star.style.XStyleFamiliesSupplier
com.sun.star.view.XRenderable
com.sun.star.document.XLinkTargetSupplier
com.sun.star.beans.XPropertySet
com.sun.star.lang.XMultiServiceFactory
com.sun.star.lang.XServiceInfo
com.sun.star.util.XNumberFormatsSupplier
com.sun.star.lang.XUnoTunnel
com.sun.star.lang.XTypeProvider
com.sun.star.uno.XWeak
com.sun.star.uno.XAggregation
Dim Dbg_Properties As String
このオブジェクトが持つ属性(プロパティ)の一覧(各属性がセミコロン記号で区切られた文字列)
Dim Dbg_Methods As String
このオブジェクトが持つメソッドの一覧(各メソッドがセミコロン記号で区切られた文字列)
インタフェースの問い合わせ
Function getCurrentSelection As Object
現在選択されているオブジェクトの参照を返す
画面表示の更新が抑制されているか否かを判定する。
Function isActionLocked() As Boolean
画面表示の更新が抑制されていればTrue、抑制されていなければFalseを返す。
無し
If ThisComponent.isActionLocked = True Then
ThisComponent.removeActionLock()
End If
画面表示の更新を抑制する。
Sub addActionLock()
無し
無し
ThisComponent.addActionLock()
画面表示更新の抑制を解除する。
Sub removeActionLock()
無し
無し
If ThisComponent.isActionLocked = True Then
ThisComponent.removeActionLock()
End If