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

推荐订阅源

博客园_首页
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
G
Google Developers Blog
B
Blog
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志
The Register - Security
The Register - Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
The Cloudflare Blog
The Hacker News
The Hacker News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
雷峰网
雷峰网
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
A
About on SuperTechFans
量子位
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
H
Help Net Security
Help Net Security
Help Net Security
P
Palo Alto Networks Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Troy Hunt's Blog
W
WeLiveSecurity
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
Know Your Adversary
Know Your Adversary
Apple Machine Learning Research
Apple Machine Learning Research
Scott Helme
Scott Helme
N
News | PayPal Newsroom
AWS News Blog
AWS News Blog
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
腾讯CDC
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
TaoSecurity Blog
TaoSecurity Blog
GbyAI
GbyAI
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
D
Docker

博客园 - hong

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

1、添加一个命令按钮

Sub AddCommandBar()
'命令
Dim cbar  As CommandBarButton


Set cbar = CommandBars("Standard").Controls("临时按钮")

If Not cbar Is Nothing Then
    
Exit Sub
End If

    
With CommandBars("Standard")
        .Protection 
= msoBarNoProtection
        
        
With .Controls.Add(msoControlButton, Before:=3)
            .DescriptionText 
= "QuitWithoutSave"
            .Caption 
= "临时按钮"
            .TooltipText 
= "临时按钮"
            .Style 
= msoButtonIconAndCaption
            .OnAction 
= "QuitWithoutSave"
        
End With
    
    
End With
End Sub

Private Sub QuitWithoutSave()
    
MsgBox "激活事件:临时按钮"
End Sub

2、删除命令按钮

CommandBars("Standard").Controls("临时按钮").Delete

3   修改word命令

'修改word命令
Sub FileSave()

MsgBox ActiveDocument.Name

If ActiveDocument.Saved = False Then
    ActiveDocument.Save
End If

End Sub


Sub FileSaveAs()
    
MsgBox "您不能另存文档"
End Sub

 4、删除顶端菜单

 CommandBars.ActiveMenuBar.Controls("Custom").Delete