一键导入
word-vba-reserved-words
Detect and avoid Microsoft Word / VBA reserved words in identifiers.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Detect and avoid Microsoft Word / VBA reserved words in identifiers.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | word-vba-reserved-words |
| description | Detect and avoid Microsoft Word / VBA reserved words in identifiers. |
| license | CC-BY-4.0 |
Help developers avoid case-insensitive identifier collisions in Word VBA.
VBA keywords & operators
Dim, If, Select, Function, ByVal, And, Or, Not, Set, Let, New, With, etc.
Built-in VBA function names
InStr, Left, Right, Mid, Len, Date, Time, Now, Format, Replace, Split, Join, Trim, etc.
Word object model names
Document, Documents, Paragraph, Paragraphs, Range, Selection, Table, Tables, Cell, Cells, Row, Rows, Column, Columns, Bookmark, Bookmarks, Style, Styles, Section, Sections, HeaderFooter, Field, Fields, Shape, Shapes, InlineShape, InlineShapes, ContentControl, ContentControls, Comment, Comments, Revision, Revisions, Find, Replacement, MailMerge, Footnote, Endnote, Hyperlink, ListFormat, PageSetup, Font, ParagraphFormat, Borders, Shading, Window, Pane, View, Options, Template, FormField, Variable, AutoText, etc.
VBA/Word SQL and special keywords
Name, Text, Value, Type, Index, Count, Item, Add, Delete, Open, Close, Save, Print, Execute, etc.
Special characters/symbols
Spaces, ', ", ., !, ?, *, +, -, =, <, >, #, %, $, &, @, \, /, ^, ~, {}, [], ().
Word and VBA treat names case-insensitively; reusing these terms as identifiers often leads to compile or runtime errors.
Priority: Complete Steps 1–4 in order. Step 5 is optional and should be considered only when explicitly requested.
DocumentPath, RangeStart) should be noted as potential concerns, but only exact or very obvious collisions require immediate action. Use judgment based on context.Document → docTarget or docReportRange → rngSelection or rngParagraphSelection → selCurrent or rngSelectedTable → tblData or tblSummaryCell → celTarget or celValueName → sDocName or sBookmarkNameText → sBodyText or sContentstrName, lngCount, dtmStart, docMain, rngTarget).Document, Range, Selection, Table, Cell, Row, Column, Style, Section, Field, Comment, Bookmark, ShapeName, Text, Value, Type, Index, Countdate, time, now, format, replaceinstr, left, right, mid, len, trimWord-specific prefixes:
| Prefix | Meaning | Example |
|---|---|---|
doc | Document | docReport, docTemplate |
par | Paragraph | parFirst, parSummary |
rng | Range | rngHeader, rngBody |
tbl | Table | tblData, tblPricing |
cel | Cell | celTotal, celName |
sty | Style | styCustom, styTitle |
sec | Section | secCover, secAppendix |
bkm | Bookmark | bkmIntro, bkmSignature |
shp | Shape | shpLogo, shpArrow |
fld | Field | fldDate, fldAuthor |
cc | Content Control | ccStatus, ccSummary |
General rules:
docInvoice, rngHeaderText, tblEmployees.str, lng, dtm, doc, rng) for clarity.Data, Info, Temp when they collide with object model terms.Document and Range."Name or Text."