将 MS Word 文档中每个句子的第一个字母加粗
我想在 MS Word 文档中将每个句子的第一个字母加粗。实现这一目标的好方法是什么?
I'd like to make first letter on each sentence bold in a MS Word document. What would be a good way to accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 VBA 中非常简单
Pretty straight-forward in VBA
这可以通过 Word 内置的高级查找+替换来完成。您需要指定一个通配符匹配表达式,例如这个表达式来选择句子分隔符和空格后面的第一个字符:
您可以指定找到的每个字符在同一 UI 中的样式(它不是严格的查找/替换 - 您可以找到/风格)。请注意,上面的表达式将同时生成每个句子的第一个字符和前面的 ?/!/。大胆的。您可以通过再次搜索标点符号并取消粗体来纠正此问题。
请参阅本指南:http://www.gmayor.com/replace_using_wildcards.htm
不太程序化,我知道,但是比深入研究VBA要快得多。
This can be done with Word's built in advanced find+replace. You would need to specify a wildcard matching expression such as this one to select the first character following a sentence delimiter and space:
You can specify how each character found is styled in the same UI (it is not strictly find/replace - you can find/style). Note that the expression above will make both the first character of each sentence and the preceding ?/!/. bold. You can correct this by doing another search for just the punctuation marks and un-bolding them.
See this guide: http://www.gmayor.com/replace_using_wildcards.htm
Not very programatic, I know, but much faster than delving into VBA.
以下对我有用
The following works for me