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

查看:260
本文介绍了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.

表示方式不同:名称必须以单词字符(但不能为数字)开头,然后任何Unicode单词字符都可以跟随40个字符的总长度.单词字符显式排除任何形式的空白和标点.

Expressed differently: The name must start with a word character (but not a digit), then any Unicode word character may follow up to an overall length of 40 characters. Word characters explicitly exclude white space and punctuation of any kind.

正如divo在评论中指出的那样,名称以下划线开头的书签被视为隐藏".无法通过用户界面创建以下划线开头的书签,但是可以通过"Bookmarks.Add"

As divo states in the comments, bookmarks with names beginning with an underscore are treated as "hidden". It it is not possible to create bookmarks that begin with an underscore via the user interface, but you can do it through "Bookmarks.Add"

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

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