惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
B
Blog
罗磊的独立博客
宝玉的分享
宝玉的分享
Vercel News
Vercel News
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
T
Threatpost
Security Latest
Security Latest
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
I
Intezer
P
Privacy International News Feed
D
Docker
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
M
MIT News - Artificial intelligence
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
Lohrmann on Cybersecurity
Google DeepMind News
Google DeepMind News
The Last Watchdog
The Last Watchdog
A
Arctic Wolf
IT之家
IT之家
S
SegmentFault 最新的问题
S
Securelist
博客园 - 叶小钗
N
News and Events Feed by Topic
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
Hacker News: Ask HN
Hacker News: Ask HN
博客园 - Franky
GbyAI
GbyAI
AI
AI
Y
Y Combinator Blog
WordPress大学
WordPress大学
Latest news
Latest news
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
N
News | PayPal Newsroom
The Cloudflare Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
I
InfoQ

博客园 - hong

VBA命令按钮操作 - hong - 博客园 RUP核心概念解析 RUP 核心概念 IBM Rational 技术文档下载 项目管理规范-RUP管理实施 感叹人生 遗憾 C#中的类型相等与恒等(Equality & Identity) Windows Vista workshop 理解抽象类和接口 线程概念 开始找工作了 BI理解 Web Service基础 改变人的一生的五句话 堆和栈的区别 在web页面中显示多页的tif文件 sql日期转换问题 Visual Studio Team System资源
VBA访问word菜单 - hong - 博客园
hong · 2007-02-02 · via 博客园 - hong

Sub SetCommandbar()
            
'
        ' SetCommandbar Macro
        ' 宏在 2007-2-1 由 创建
        '
        '菜单
        '菜单
        Dim cbar  As CommandBarButton

                      
'菜单>新建
        Set cbar = CommandBars("File").Controls("新建(&N)")
            cbar.Enabled 
= False
                               cbar.OnAction 
= "NullMethod"
        cbar.ShortcutText 
= ""
        
'cbar.Reset
        '菜单>打开
        Set cbar = CommandBars("File").Controls("打开(&O)")
            cbar.Enabled 
= False '
        cbar.OnAction = "NullMethod"
        cbar.ShortcutText 
= ""
        
'cbar.Reset
        '菜单>保存
        Set cbar = CommandBars("File").Controls("保存(&S)")
            cbar.Enabled 
= False '
        cbar.OnAction = "NullMethod"
        cbar.ShortcutText 
= ""
        
'cbar.Reset
        '菜单>另存为
        Set cbar = CommandBars("File").Controls("另存为(&A)")
            cbar.Enabled 
= False '
        cbar.OnAction = "NullMethod"
        cbar.ShortcutText 
= ""
        
'cbar.Reset
        '命令>新建
        Set cbar = CommandBars("Standard").Controls(1)
            cbar.Visible 
= True
                               cbar.Enabled 
= False '
        cbar.OnAction = "NullMethod"
        cbar.ShortcutText 
= ""
        
'cbar.Reset
        '命令>打开
        Set cbar = CommandBars("Standard").Controls("打开(&O)")
            cbar.Visible 
= True
                               cbar.Enabled 
= False '
        cbar.OnAction = "NullMethod"
        cbar.ShortcutText 
= ""
        
'cbar.Reset
        '命令>保存
        Set cbar = CommandBars("Standard").Controls("保存(&S)")
            cbar.Visible 
= True
                               cbar.Enabled 
= False '
        cbar.OnAction = "NullMethod"
        cbar.ShortcutText 
= ""
        
'cbar.Reset


        
'CommandBars("Standard").Controls(1).ShortcutText = ""



        
'快捷键Ctrl+N 和Ctrl+O
        'Set cbar = CommandBars.ActionControl
        Set myControl = Application.CommandBars.FindControl _
                                                                (Type:
=msoControlPopup, Visible:=True)



        
End Sub

            
Private Sub NullMethod()

                            
End Sub

                                
Sub myreset()
                                    
'菜单
        Dim cbar  As CommandBarButton

                      
'菜单>新建
        Set cbar = CommandBars("File").Controls("新建(&N)")
            cbar.Reset
                
'菜单>打开
        Set cbar = CommandBars("File").Controls("打开(&O)")
            cbar.Reset
                
'菜单>保存
        Set cbar = CommandBars("File").Controls("保存(&S)")
            cbar.Reset
                
'菜单>另存为
        Set cbar = CommandBars("File").Controls("另存为(&A)")
            cbar.Reset
                
'命令>新建
        Set cbar = CommandBars("Standard").Controls(1)
            cbar.Reset
                
'命令>打开
        Set cbar = CommandBars("Standard").Controls("打开(&O)")
            cbar.Reset
                
'命令>保存
        Set cbar = CommandBars("Standard").Controls("保存(&S)")
            cbar.Reset
                
End Sub
                        
Sub aaa()

                                
' aaa Macro
        ' 宏在 2007-2-2 由 张文璋 创建
        '

        
End Sub