マクロをつかっているとどんなオブジェクトがあるのとか、オブジェクトとのプロパティ、メソッドを知りたいことがあります。幸いなことに、マクロには、プロパティ、メソッド用の関数が用意されています。
では、ちょっと試してみましょう。ThisComponent という トップレベルにあるオブジェクトを調べます。
まず、プロパティ
msgbox(Thiscomponent.dbg_propeties)
msgbox のウィンドウには下記が表示されます。
Properties of object "ThisComponent":
SbxSTRING URL; SbxARRAY Args;
SbxOBJECT CurrentController; SbxOBJECT CurrentSelection;
SbxOBJECT Controllers; SbxARRAY AvailableViewControllerNames;
SbxBOOL Modified; SbxSTRING Location;
SbxARRAY Printer; SbxSTRING ImplementationName;
SbxARRAY SupportedServiceNames; SbxOBJECT DataSource;
SbxOBJECT FormDocuments; SbxOBJECT ReportDocuments;
SbxARRAY DocumentSubStoragesNames; SbxOBJECT UIConfigurationManager;
SbxOBJECT DocumentStorage; SbxOBJECT BasicLibraries;
SbxOBJECT DialogLibraries; SbxBOOL AllowMacroExecution;
SbxOBJECT ScriptContainer; SbxOBJECT ScriptProvider;
SbxOBJECT Events; SbxARRAY Types;
SbxARRAY ImplementationId; SbxSTRING Title;
SbxSTRING UntitledPrefix; SbxSTRING Dbg_SupportedInterfaces;
SbxSTRING Dbg_Properties; SbxSTRING Dbg_Methods
次は、メソッド
msgbox(Thiscomponent.dbg_methods)
Methods of object "ThisComponent":
SbxEMPTY queryInterface ( SbxOBJECT ) ; 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 createViewController ( SbxSTRING, SbxARRAY, SbxOBJECT ) ; SbxVOID addModifyListener ( SbxOBJECT ) ; SbxVOID removeModifyListener ( SbxOBJECT ) ;
SbxBOOL isModified ( void ) ; SbxVOID setModified ( SbxBOOL ) ; SbxBOOL hasLocation ( void ) ;
SbxSTRING getLocation ( void ) ; SbxBOOL isReadonly ( void ) ; SbxVOID store ( void ) ;
SbxVOID storeAsURL ( SbxSTRING, SbxARRAY ) ; SbxVOID storeToURL ( SbxSTRING, SbxARRAY ) ; SbxVOID addEventListener ( SbxOBJECT ) ;
SbxVOID removeEventListener ( SbxOBJECT ) ; SbxVOID addDocumentEventListener ( SbxOBJECT ) ; SbxVOID removeDocumentEventListener ( SbxOBJECT ) ;
SbxVOID notifyDocumentEvent ( SbxSTRING, SbxOBJECT, SbxVARIANT ) ; SbxARRAY getPrinter ( void ) ; SbxVOID setPrinter ( SbxARRAY ) ;
SbxVOID print ( SbxARRAY ) ; SbxVOID addCloseListener ( SbxOBJECT ) ; SbxVOID removeCloseListener ( SbxOBJECT ) ;
SbxVOID close ( SbxBOOL ) ; SbxSTRING getImplementationName ( void ) ; SbxBOOL supportsService ( SbxSTRING ) ;
SbxARRAY getSupportedServiceNames ( void ) ; SbxOBJECT getFormDocuments ( void ) ; SbxOBJECT getReportDocuments ( void ) ;
SbxOBJECT getDocumentSubStorage ( SbxSTRING, SbxLONG ) ; SbxARRAY getDocumentSubStoragesNames ( void ) ; SbxOBJECT getUIConfigurationManager ( void ) ;
SbxVOID loadFromStorage ( SbxOBJECT, SbxARRAY ) ; SbxVOID storeToStorage ( SbxOBJECT, SbxARRAY ) ; SbxVOID switchToStorage ( SbxOBJECT ) ;
SbxOBJECT getDocumentStorage ( void ) ; SbxVOID addStorageChangeListener ( SbxOBJECT ) ; SbxVOID removeStorageChangeListener ( SbxOBJECT ) ;
SbxOBJECT getScriptProvider ( void ) ; SbxOBJECT getEvents ( void ) ; SbxVOID initNew ( void ) ;
SbxVOID load ( SbxARRAY ) ; SbxBOOL wasModifiedSinceLastSave ( void ) ; SbxVOID storeToRecoveryFile ( SbxSTRING, SbxARRAY ) ;
SbxVOID recoverFromFile ( SbxSTRING, SbxSTRING, SbxARRAY ) ; SbxARRAY getTypes ( void ) ; SbxARRAY getImplementationId ( void ) ;
SbxOBJECT queryAdapter ( void ) ; SbxSTRING getTitle ( void ) ; SbxVOID setTitle ( SbxSTRING ) ;
SbxVOID addTitleChangeListener ( SbxOBJECT ) ; SbxVOID removeTitleChangeListener ( SbxOBJECT ) ; SbxLONG leaseNumber ( SbxOBJECT ) ;
SbxVOID releaseNumber ( SbxLONG ) ; SbxVOID releaseNumberForComponent ( SbxOBJECT ) ; SbxSTRING getUntitledPrefix ( void )
これで、結構便利になります。