Supportnet Computer
Planet of Tech

Supportnet / Forum / Anwendungen(Java,C++...)

Wei kann ich ein Add-In für office selber erstellen





Frage

Hallo, ich ahbe eine kleine VB Anwendung gebaut. diese möchte ich nun in form von einem ADD in in Word und exel einfügen. ich stell mir das so vor. Ich hab zu schluss ein kleines Setup das man ausführt und dannach hat man in der Menüleiste von word und exel einen button mehr!!! ich will das aber nicht als Makro machen sondern als Add-In. Geht sowas und weiß einer wie? danke im vorraus Newan

Antwort 1 von Newan

Hat den keiner eine Idee...mir würde ja schon reichen wenn ich weiß wie man überhaupt ein add in für word oder excel erstellt


Jens


Antwort 2 von Newan

Also folgendes:


meines wissens nach musst du schon ein addin in word resp. excel erstellen. du kannst nicht in vb
 ein programm schreiben und das dann in form 
eines addins laden.

hier ein bsp wie du in excel ein addin erstellen kannst.

1. erstelle eine normale excel datei.
2. ergänze das file mit entsprechendem vba code.
3. speichere das file unter *.xla ab anstelle *.xls
4. file schliessen
5. in excel unter menu => extras => addins kann das addin geladen werden.

hier noch beispiel code für das erstellen eines menübuttons zur laufzeit (für ein excel addin):

code in thisworkbook kopieren:


    Option Explicit        Private Const XLS_MenuBar As String = "Worksheet Menu Bar"Private Sub Workbook_AddinInstall()  
  Call Add_CustomCommandButton(Application.CommandBars(XLS_MenuBar))
End Sub

Private Sub Workbook_AddinUninstall()  
  Call Add_CustomCommandButton(Application.CommandBars(XLS_MenuBar))
End Sub

Private Sub Workbook_Open()  
  Call Add_CustomCommandButton(Application.CommandBars(XLS_MenuBar))
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)   
 Call Delete_CustomCommandButton(Application.CommandBars(XLS_MenuBar))
End Sub

code in ein modul kopieren:


    Option Explicit   
     Private Const CMDB_TagValue As String = "myCustomCommandButton"   
 Private Const CMDB_Function As String = "Function_CustomCmdButton"
Sub Add_CustomCommandButton(cBar As CommandBar)    
Dim cmdB As CommandBarButton 
       Set cmdB = cBar.FindControl(msoControlButton, , CMDB_TagValue, True)        If cmdB Is Nothing Then   
                 Set cmdB = cBar.Controls.Add(msoControlButton, , , , True)            cmdB.BeginGroup = True         
   cmdB.Caption = " &Custom CommandButton (F12)"           
 cmdB.FaceId = 2950         
   cmdB.OnAction = "OnTime_CustomCmdButton"     
       cmdB.Style = msoButtonIconAndCaption        
    cmdB.Tag = CMDB_TagValue            cmdB.TooltipText = "Tooltip fehlt!"            End If       
 Application.OnKey "{F12}", CMDB_Function 
   End Sub

Sub Delete_CustomCommandButton(cBar As CommandBar)       
 Dim cmdB As CommandBarButton   
     Set cmdB = cBar.FindControl(msoControlButton, , CMDB_TagValue) 
   If Not cmdB Is Nothing Then cmdB.Delete        Application.OnKey "{F12}"  
  End 

SubPrivate Sub OnTime_CustomCmdButton()    Application.OnTime Now(), CMDB_Function  
 End Sub

Private Sub Function_CustomCmdButton()    MsgBox "Funktion noch nicht implementiert!", vbInformation, "Info"  
 End Sub


und unter COM-ADD-IN in der windows hilfe und im Internet.....swoeit bin ich jetzt schon mal gekommen???

Jetzt tüfftel ich mal weiter...häng immoment wann ich das passende event von Office bekomme bzw welche bedeutung die Events haben!
(Nein es sind nicht die events die oben stehen es sind andere :-))

Newan

Antwort 3 von WauWau

Hi
Du brauchst nen Setup-Generator, dort ziehst du
das script rein und konfigurierst welches Betriebssystem, welches Office etc. und speicherst das
ganze als .EXE File ab!

Bitte frag mich nicht wie die Dinger jetzt heißen,
ist schon sehr sehr lange her wie ich mit dem Zeugs gearbeitet habe.

WauWau

Antwort 4 von Newan

danke ich schau mal bei google anch find ich bestimmt was.. *g*



Newan

Ich möchte kostenlos eine Frage an die Mitglieder stellen:


Ähnliche Themen:


Suche in allen vorhandenen Beiträgen: