Option
Explicit
Option
Compare Text
'*Installation
Addin->Menubar
Const
°AddinName As String = "Pfade_anpassen"
Sub
Auto_Open()
'----------------< Auto_Open()
>----------------
'--< Install_MenuBar >--
Dim addin_Commandbar As CommandBar
Set addin_Commandbar =
find_Commandbar(°AddinName)
'< check >
If Not addin_Commandbar Is Nothing Then
addin_Commandbar.Visible = True
Exit Sub
End If
'</ check >
On Error GoTo 0
'--< Install_MenuBar >--
'< create new >
Set addin_Commandbar =
CommandBars.Add(Name:=°AddinName, Position:=msoBarFloating, Temporary:=False)
'</
create new >
'----< Menue_Punkte_einfuegen >----
Dim control_Element As CommandBarButton
'------------< 1 >------------
Set control_Element =
addin_Commandbar.Controls.Add
control_Element.Caption
= "Pfade austauschen"
control_Element.OnAction = "fx_Pfade_austauschen"
control_Element.FaceId = 893
control_Element.Style = msoButtonIconAndCaption
control_Element.BeginGroup = True
'------------</ 1 >------------
'----</ Menue_Punkte_einfuegen >----
'< anzeigen >
addin_Commandbar.Visible = True
'</ anzeigen >
'----------------</ Auto_Open()
>----------------
End
Sub
Sub
Auto_Close()
'----------------< Uninstall in
PowerPoint ??() >---------------
'--< find_commandbar >--
Dim addin_Commandbar As CommandBar
Set addin_Commandbar = find_Commandbar(°AddinName)
'< check >
If Err.Number <> 0 Then Exit Sub
If addin_Commandbar Is Nothing Then Exit
Sub
'</ check >
'--</ find_commandbar >--
addin_Commandbar.Delete
'----------------</ Uninstall in
PowerPoint ??() >---------------
End
Sub
'=====================<
Helper-Functions >==============
Public
Function find_Commandbar(ByVal sName As String) As CommandBar
'-----------< find_Commandbar()
>--------------
Dim search_Commandbar As CommandBar
'----< @Loop: all_Commandbars >----
For Each search_Commandbar In
Application.CommandBars
If search_Commandbar.Name = sName
Then
'< match_return >
Set find_Commandbar =
search_Commandbar
Exit Function 'not necessary
'</ match_return >
End If
Next
'----</ @Loop: all_Commandbars
>----
'< nomatch >
Set find_Commandbar = Nothing
'</ nomatch >
'-----------</ find_Commandbar()
>--------------
End
Function
'=====================</
Helper-Functions >==============
|