設(shè)為首頁收藏本站Access中國

Office中國論壇/Access中國論壇

 找回密碼
 注冊

QQ登錄

只需一步,快速開始

返回列表 發(fā)新帖
查看: 2750|回復(fù): 3
打印 上一主題 下一主題

OFFCE加載項(xiàng)運(yùn)行無結(jié)果

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
1#
發(fā)表于 2016-9-29 17:20:19 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
Public Class ThisAddIn

    Private Sub ThisAddIn_Startup() Handles Me.Startup
        AddCommandBar()
    End Sub

    Private Sub ThisAddIn_Shutdown() Handles Me.Shutdown
        If mCommandBar IsNot Nothing Then
            mCommandBar.Delete()
        End If

    End Sub
    Private mCommandbar As Office.CommandBar
    Private Sub AddCommandBar()
        Try
            mCommandbar = Application.CommandBars.Add("1", Office.MsoBarPosition.msoBarTop, True, False)
            If mCommandbar IsNot Nothing Then
                Dim commandBtn As Office.CommandBarButton = mCommandbar.Controls.Add(Office.MsoControlType.msoControlButton)
                With commandBtn
                    .Caption = "試手"
                    .FaceId = 59
                    .Style = Microsoft.Office.Core.MsoButtonStyle.msoButtonCaption
                    .Visible = True
                    AddHandler .Click, AddressOf c1_Click

                End With
         

                mCommandbar.Visible = True

            End If



        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub
    Private Sub c1_Click(control As Office.CommandBarButton, ByRef cancel As Boolean)

        MsgBox("1")
    End Sub

End Class


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享分享 分享淘帖 訂閱訂閱
2#
 樓主| 發(fā)表于 2016-9-29 17:21:58 | 只看該作者
請教高人為什么點(diǎn)擊按鈕不彈出一個(gè)對話框
3#
 樓主| 發(fā)表于 2016-9-30 11:05:44 | 只看該作者
已解決 加TAG
4#
發(fā)表于 2016-10-8 13:26:07 | 只看該作者
為什么 只運(yùn)行一次?
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則

QQ|站長郵箱|小黑屋|手機(jī)版|Office中國/Access中國 ( 粵ICP備10043721號(hào)-1 )  

GMT+8, 2025-7-13 08:02 , Processed in 0.270200 second(s), 27 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回復(fù) 返回頂部 返回列表