Top > OOoBasic > Generic > RemoveLibrary
* マクロを削除する [#dac9c177]


以下の例は新規作成の OnNew イベントにマクロが割り当てられているテンプレートのイベントを削除、ライブラリごとマクロを削除します。
Sub NewFileCreated
  'oDoc = ThisComponent
  UnRegisterEvent(oDoc, "OnNew")
  RemoveLibrary(oDoc, "Standard")
End Sub

Sub UnRegisterEvent(oDoc As Object, sEventName As String )
  oEvents = oDoc.getEvents()
  If oEvents.hasByName(sEventName) Then
    Dim aArgs(0) As New
    oEvents.replaceByName(sEventName, aArgs)
  End If
End Sub

Sub RemoveLibrary(oDoc As Object, sLibName As String)
  oLibs = oDoc.BasicLibraries
  If oLibs.hasByName(sLibName) Then
  End If
End Sub

Reload   New Lower page making Edit Freeze Diff Upload Copy Rename   Front page List of pages Search Recent changes Backup   Help   RSS of recent changes