Microsoft Word 中书签名称的限制是什么? [英] What are the limitations for bookmark names in Microsoft Word?

查看:27
本文介绍了Microsoft Word 中书签名称的限制是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要根据段落名称为文档的某些部分添加书签,但段落名称并不总是书签名称的有效名称.我没有在 Google 或 MSDN 上找到有关书签名称的详尽限制列表.

I need to bookmark parts of a document from the name of paragraphs but the name of a paragraph is not always a valid name for a bookmark name. I have not found on Google or MSDN an exhaustive list of limitations for bookmark names.

禁止使用哪些特殊字符?

What special characters are forbidden?

我唯一发现的是长度不能超过 40 个字符.

The only thing I found is that the length must not exceed 40 characters.

推荐答案

如果你熟悉正则表达式,我会说它是

If you are familiar with regular expressions, I would say it is

^(?!d)w{1,40}$

其中w指的是Unicode单词字符的范围,也包含下划线和0-9的数字.

Where w refers to the range of Unicode word characters, which also contain the underscore and the digits from 0-9.

简单的英语:书签名称必须...

In plain English: The bookmark name must...

  • 长度在 1 到 40 个字符之间
  • 由 Unicode 字母、数字、下划线的任意组合组成
  • 不是以数字开头
  • 包含任何类型的空格或标点
  • be between 1 and 40 characters long
  • consist of any combination of Unicode letters, digits, underscores
  • not start with a digit
  • not contain any kind of white space or punctuation

如评论中所述,以下划线开头的书签名称被视为隐藏.它们不会出现在常规用户界面中,但可以从 VBA 代码中使用.无法通过常规用户界面创建以下划线开头的书签,但您可以通过 VBA 代码使用 Bookmarks.Add() 来实现.

As stated in the comments, bookmark names beginning with an underscore are treated as hidden. They will not appear in the regular user interface, but they can be used from VBA code. It it is not possible to create bookmarks that begin with an underscore via the regular user interface, but you can do it through VBA code with Bookmarks.Add().

这篇关于Microsoft Word 中书签名称的限制是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆