首页 > 其他分享 >VBA 获取Word 所有CommandBar ID命令按钮

VBA 获取Word 所有CommandBar ID命令按钮

时间:2023-09-12 13:33:48浏览次数:33  
标签:VBA Popup Word CommandBar 名称 Pane Table ID

Sub 获取所有CommandBarID()
    Dim wdApp As Object             ' Word.Application
    Dim cb As Object                ' CommandBar
    Dim s As String, id As String
 
    Set wdApp = CreateObject("Word.Application")
 
    With wdApp
        .Visible = True
        .Documents.Add ' 新建Word文档
 
        For Each cb In .CommandBars
            s = cb.Name
            id = cb.id
            Debug.Print "CommandBar名称: " & s & ", ID: " & id
        Next cb
 
        Set wdApp = Nothing
    End With
    MsgBox "已获取所有CommandBar ID"
End Sub

CommandBar名称: Diagram, ID: 1435
CommandBar名称: Reviewing, ID: 142
CommandBar名称: AutoSummarize, ID: 537
CommandBar名称: Exit Design Mode, ID: 502
CommandBar名称: Control Toolbox, ID: 244
CommandBar名称: Text Box, ID: 530
CommandBar名称: Outlook Read Mail, ID: 589
CommandBar名称: Outlook Send Mail, ID: 588
CommandBar名称: Function Key Display, ID: 1028
CommandBar名称: Web Tools, ID: 1089
CommandBar名称: Word Count, ID: 1424
CommandBar名称: Japanese Greetings, ID: 1495
CommandBar名称: Menu Bar, ID: 37
CommandBar名称: Refresh, ID: 159
CommandBar名称: Frames, ID: 1085
CommandBar名称: E-mail, ID: 1682
CommandBar名称: Full Screen Reading, ID: 1710
CommandBar名称: Document Layout, ID: 1973
CommandBar名称: Compare Side by Side, ID: 1888
CommandBar名称: Ink Drawing and Writing, ID: 1931
CommandBar名称: Ink Annotations, ID: 1932
CommandBar名称: Ink Comment, ID: 1992
CommandBar名称: Style Inspector, ID: 2133
CommandBar名称: &Legacy Keyboard Support, ID: 2385
CommandBar名称: Format Object, ID: 2490
CommandBar名称: Selection, ID: 2202
CommandBar名称: Task Pane, ID: 1423
CommandBar名称:  , ID: 1826
CommandBar名称: Property Editor, ID: 2089
CommandBar名称: Office Clipboard, ID: 2095
CommandBar名称: XML Source, ID: 1690
CommandBar名称: Research, ID: 1725
CommandBar名称: XML Document, ID: 1893
CommandBar名称: Signatures, ID: 2087
CommandBar名称: Document Actions, ID: 1788
CommandBar名称: Clip Art, ID: 1521
CommandBar名称: Reading Order, ID: 3108
CommandBar名称: Document Management, ID: 1862
CommandBar名称: Document Updates, ID: 1776
CommandBar名称: Mail Merge Panes, ID: 2215
CommandBar名称: Fax Service, ID: 1820
CommandBar名称: Meeting Workspace, ID: 1777
CommandBar名称: Attachment Options, ID: 1749
CommandBar名称: Accessibility, ID: 2440
CommandBar名称: Editor, ID: 2472
CommandBar名称: Dictionaries, ID: 3001
CommandBar名称: Thesaurus, ID: 3017
CommandBar名称: History, ID: 3038
CommandBar名称: Share, ID: 3040
CommandBar名称: Smart Lookup, ID: 3039
CommandBar名称: Version History, ID: 3047
CommandBar名称: Researcher, ID: 3049
CommandBar名称: Insert From File, ID: 3050
CommandBar名称: Help, ID: 3053
CommandBar名称: Online Content, ID: 3057
CommandBar名称: Alt Text, ID: 3064
CommandBar名称: Feedback, ID: 3070
CommandBar名称: Data Selector, ID: 3074
CommandBar名称: Comments, ID: 3080
CommandBar名称: Contact Support, ID: 3097
CommandBar名称: Troubleshooter, ID: 3098
CommandBar名称: Activity, ID: 3095
CommandBar名称: Admin Tenant Portal, ID: 3103
CommandBar名称: Notifications, ID: 3104
CommandBar名称: User Voice, ID: 3105
CommandBar名称: Search Feedback, ID: 3107
CommandBar名称: Do more with Surface, ID: 3111
CommandBar名称: Outlook Room Finder Pane, ID: 3113
CommandBar名称: Outlook Meeting Insights Pane, ID: 3115
CommandBar名称: Outlook Notifications Pane, ID: 3120
CommandBar名称: Diagnostic Pane, ID: 3121
CommandBar名称: Diagnostic Pane, ID: 3122
CommandBar名称: Diagnostic Pane, ID: 3123
CommandBar名称: Diagnostic Pane, ID: 3124
CommandBar名称: Data Types Refresh Settings, ID: 3125
CommandBar名称: Outlook My Day Pane, ID: 3126
CommandBar名称: Changes, ID: 3130
CommandBar名称: Outlook FindTime Pane, ID: 3135
CommandBar名称: Unsaved Changes, ID: 3136
CommandBar名称: Workbook Performance, ID: 3140
CommandBar名称: Excel Task Pane, ID: 3141
CommandBar名称: Workbook Links, ID: 3147
CommandBar名称: Diagnostics, ID: 3152
CommandBar名称: Python in Excel, ID: 3153
CommandBar名称: Hello AI, ID: 3157
CommandBar名称: Accessibility Assistant, ID: 3158
CommandBar名称: Advertisement Pane, ID: 3160
CommandBar名称:  , ID: 1
CommandBar名称:  , ID: 1
CommandBar名称:  , ID: 1
CommandBar名称: Chinese Translation, ID: 1090
CommandBar名称: Drop Caps, ID: 55
CommandBar名称: Endnotes, ID: 56
CommandBar名称: Fields, ID: 57
CommandBar名称: Display Fields, ID: 58
CommandBar名称: Field Display List Numbers, ID: 954
CommandBar名称: Form Fields, ID: 59
CommandBar名称: Footnotes, ID: 60
CommandBar名称: Frames, ID: 61
CommandBar名称: Headings, ID: 62
CommandBar名称: Linked Headings, ID: 63
CommandBar名称: Script Anchor Popup, ID: 984
CommandBar名称: Lists, ID: 64
CommandBar名称: Inline Picture, ID: 156
CommandBar名称: Inline Canvas, ID: 1482
CommandBar名称: Horizontal Line Popup, ID: 985
CommandBar名称: Tables, ID: 66
CommandBar名称: Table Cells, ID: 67
CommandBar名称: Table Headings, ID: 68
CommandBar名称: Table Lists, ID: 69
CommandBar名称: Table Pictures, ID: 70
CommandBar名称: Table Text, ID: 71
CommandBar名称: Whole Table, ID: 72
CommandBar名称: Linked Table, ID: 73
CommandBar名称: Text, ID: 74
CommandBar名称: Word Previewer, ID: 2145
CommandBar名称: Linked Text, ID: 75
CommandBar名称: Font Popup, ID: 77
CommandBar名称: Font Paragraph, ID: 78
CommandBar名称: Format Inspector Popup in Normal Mode, ID: 1597
CommandBar名称: Format Inspector Popup in Compare Mode, ID: 1598
CommandBar名称: Spelling, ID: 79
CommandBar名称: Grammar, ID: 102
CommandBar名称: Grammar (2), ID: 1041
CommandBar名称: Format consistency, ID: 1493
CommandBar名称: Background Proofing Status Bar, ID: 957
CommandBar名称: Track Changes, ID: 542
CommandBar名称: Frame Properties, ID: 161
CommandBar名称: Hyperlink Context Menu, ID: 545
CommandBar名称: AutoSignature Popup, ID: 988
CommandBar名称: Field AutoText, ID: 144
CommandBar名称: Document Map, ID: 953
CommandBar名称: Shapes, ID: 54
CommandBar名称: Curve, ID: 232
CommandBar名称: Curve Node, ID: 233
CommandBar名称: Curve Segment, ID: 234
CommandBar名称: Floating Picture, ID: 157
CommandBar名称: Canvas Popup, ID: 1440
CommandBar名称: OLE Object, ID: 235
CommandBar名称: ActiveX Control, ID: 598
CommandBar名称: WordArt Context Menu, ID: 237
CommandBar名称: Rotate Mode, ID: 238
CommandBar名称: Comment, ID: 543
CommandBar名称: Organization Chart Popup, ID: 1434
CommandBar名称: Diagram, ID: 1039
CommandBar名称: Connector, ID: 236
CommandBar名称: Track Changes Indicator, ID: 544
CommandBar名称: Address Block Popup, ID: 1594
CommandBar名称: Greeting Line Popup, ID: 1595
CommandBar名称: Barcode Merge Field Popup, ID: 3010
CommandBar名称: Inline ActiveX Control, ID: 1096
CommandBar名称: Word CoAuthoring, ID: 2451
CommandBar名称: XML Error Options, ID: 1858
CommandBar名称: Ink Comment, ID: 2004
CommandBar名称: Business Card, ID: 2272
CommandBar名称: Equation Popup, ID: 2360
CommandBar名称: Header Area Popup, ID: 2343
CommandBar名称: Footer Area Popup, ID: 2344
CommandBar名称: Text, ID: 2374
CommandBar名称: Tables, ID: 2375
CommandBar名称: Table Cells, ID: 2376
CommandBar名称: Table Lists, ID: 2377
CommandBar名称: Table Pictures, ID: 2378
CommandBar名称: Table Text, ID: 2379
CommandBar名称: Whole Table, ID: 2380
CommandBar名称: Linked Table, ID: 2381
CommandBar名称: Lists, ID: 2382
CommandBar名称: Hyperlink Context Menu, ID: 2383
CommandBar名称: Word Page Numbering Options, ID: 2431
CommandBar名称: AutoShapes, ID: 4273
CommandBar名称: Callouts, ID: 4275
CommandBar名称: Flowchart, ID: 4276
CommandBar名称: Block Arrows, ID: 4277
CommandBar名称: Stars & Banners, ID: 4278
CommandBar名称: Lines, ID: 4250
CommandBar名称: Basic Shapes, ID: 4274
CommandBar名称: Connectors, ID: 4629
CommandBar名称: Fill Color, ID: 4242
CommandBar名称: Insert Shape, ID: 5742
CommandBar名称: Line Color, ID: 4243
CommandBar名称: Drawing and Writing Pens, ID: 5985
CommandBar名称: Annotation Pens, ID: 6029
CommandBar名称: Drawing and Writing Pens, ID: 6154
CommandBar名称: Annotation Pens, ID: 6153
CommandBar名称: Align or Distribute, ID: 4607
CommandBar名称: Rotate or Flip, ID: 4234
CommandBar名称: Order, ID: 4231
CommandBar名称: Nudge, ID: 4271
CommandBar名称: Borders, ID: 4107
CommandBar名称: Font Color, ID: 4481
CommandBar名称: Shading Color, ID: 5048
CommandBar名称: Cell Alignment, ID: 5139
CommandBar名称: Text Wrapping, ID: 4297
CommandBar名称: Clipboard, ID: 983
CommandBar名称: Envelope, ID: 1030
CommandBar名称: System, ID: 193
CommandBar名称: Business Bar, ID: 2149
CommandBar名称: Status Bar, ID: 2086
CommandBar名称: Ribbon, ID: 2099

 

标签:VBA,Popup,Word,CommandBar,名称,Pane,Table,ID
From: https://www.cnblogs.com/guangzhiruijie/p/17695903.html

相关文章

  • UVA-1401 - Remember the Word -----Trie前缀树
    题意:给出N个不同单词和一个长字符串S。把这个字符串分解成若干个单词的连接(单词尅重复使用),问有多少种方法?分析:令d[i]表示从字符i开始的字符串的分解方案数,则d[i]=sum{d[i+len[x]]|单词x是S[i...len]的前缀};详看《算法竞赛入门经典》---刘汝佳--Page208.......
  • Python合并不同Word并同时添加多个分页符的方法
      本文介绍基于Python,实现对多个Word文档加以自动合并,并在每次合并时按要求增添一个分页符的方法。  现有多个Word文档文件,需将其按名称顺序合并为一个新的Word文件,且需保证每一次合并时,都另起一页(即新的Word文件一页中,不能出现两个及以上的原本单个Word文件的内容)。  一般......
  • Unity 性能优化Shader分析处理函数:ShaderUtil.GetShaderGlobalKeywords用法
    Unity性能优化Shader分析处理函数:ShaderUtil.GetShaderGlobalKeywords用法点击封面跳转下载页面简介Unity性能优化Shader分析处理函数:ShaderUtil.GetShaderGlobalKeywords用法在Unity开发中,性能优化是一个非常重要的方面。一个常见的性能优化技巧是使用ShaderUtil.GetSha......
  • Unity 性能优化Shader分析处理函数:ShaderUtil.GetShaderGlobalKeywords用法
    Unity性能优化Shader分析处理函数:ShaderUtil.GetShaderGlobalKeywords用法点击封面跳转下载页面简介Unity性能优化Shader分析处理函数:ShaderUtil.GetShaderGlobalKeywords用法在Unity开发中,性能优化是一个非常重要的方面。一个常见的性能优化技巧是使用ShaderUtil.GetSh......
  • VBA批量创建文件夹
    SubcreateFolder()DimwksAsWorksheetOnErrorResumeNextSetwks=ThisWorkbook.Worksheets(1)basepath=ThisWorkbook.Path&"\"Max=wks.Range("A100000").End(xlUp).RowFori=2ToM......
  • nopi 2.6.1 读word docx,写Excel xsls 源代码例子
    ///<summary>///获取.docx文件内容,使用NPOI.XWPF插件解析///</summary>///<paramname="strFilePath">文件路径</param>///<returns></returns>publicstringGetDocxContent(stri......
  • vue 页面导出为pdf与word
    vue页面导出为pdf与word一.导出为word 基于 docxtemplater 来导出word文档的方法1.安装引用依赖//安装docxtemplaternpminstalldocxtemplaterpizzip--save//安装jszip-utilsnpminstalljszip-utils--save//安装jszipnpminstalljszip--save//安装......
  • Spring Boot 中使用 Poi-tl 渲染数据并生成 Word 文档
    本文Demo已收录到demo-for-all-in-java项目中,欢迎大家star支持!后续将持续更新!前言产品经理急冲冲地走了过来。「现在需要将按这些数据生成一个Word报告文档,你来安排下」项目中有这么一个需求,需要将用户填写的数据填充到一个Word文档中,而这个Word文档是人家给定......
  • VBA*CommandBars控制菜单栏上的菜单(如页面设置、打印)
    Subtest()'视图工具栏中,各种工具对应的英文名称'worksheetmenubar表示工作表菜单栏Application.CommandBars("worksheetmenubar").Enabled=false'formatting表示格式工具栏Application.CommandBars("Formatting").Visible=False'standard表示常用工具栏Appl......
  • John:No password hashes left to crack (see FAQ)
    使用john--wordlist=/usr/share/wordlists/rockyou.txt文件名出现:Usingdefaultinputencoding:UTF-8Loaded1passwordhash(netntlmv2,NTLMv2C/R[MD4HMAC-MD532/64])Nopasswordhasheslefttocrack(seeFAQ)说明该文件已经被破解过,结果存放在john.pot中......