使用VBA for word选择文本并使其加粗
我每周都会制作一份几页的word文档。我从 PDF 复制文本并将其粘贴到 Word 文档中,然后设置粘贴文本的格式。
这需要很长时间,我想将其自动化。
我需要一个宏或一些代码来选择特定文本,然后将该文本设置为粗体。我需要加粗的具体文本就是我所说的废代码。
有 60 种不同的代码。例如“FIPS”或“LILL”。
I make a several page word document every week. I copy text from a PDF and paste it into a word document, I then format the text that I pasted.
This takes a long time and i would like to automate it.
I need a macro or some code to select specific text, then make that text bold. The specific text i need to bold is what i call a scrap code.
There are 60 different codes. For example "FIPS", or "LILL".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
像这样的:
HTH!
编辑
将美元金额切换为粗体
Something like this:
HTH!
Edit
To switch dollar amounts to bold
我建议录制一个宏。
然后进行所有修改和格式化。
最后看一下宏的代码,看看它是怎么做的。
您需要弄清楚的一件事是如何从逻辑上找到要加粗的文本。
是特定线路吗?它位于已知单词的开头吗?
一旦找到答案,您就可以将其与宏代码结合起来并自动执行任务。
I would suggest recording a macro.
Then do all the modifications and formatting.
Finally, look at the code of the macro and see how it did it.
The one thing you need to figure out is how you logically want to locate the text you want to bold.
Is it a specific line? Is it at the beginning of a known word?
Once you have that answered, you can combine it with the code of the macro and automate the task.