【问题标题】:Make middle of Word sentence BOLD only只在单词中间加粗
【发布时间】:2014-04-28 16:42:39
【问题描述】:

我有一个 Access 2010 数据库,我需要在其中创建字母(Word 文档)。字母的某些部分我想加粗,但是当我尝试设置它时,它也会使同一行上的前面的文本也加粗。 我不认为 Find 在这种情况下会起作用(我发现了很多使用 Find 进行格式化的例子!),因为数据发生了变化;可能是可能的,但是非常繁琐地确定它的开始和结束位置。 但是,我可以在处理数据时以不同的块捕获数据,所以我尝试了这样的事情......

With oParagraph .Range.Text = sContent .Range.InsertAfter (sPreviewLetter) .Range.InsertAfter (sECText1) .Range.Collapse (wdCollapseEnd) End With With oParagraph .Range.InsertAfter (sECText2) .Range.Bold = True End With With oParagraph .Range.InsertAfter (sECText3) End With

对我来说似乎没有什么能正常工作,但我希望它在现实中很简单。在上面的 sn-p 中,我希望 sECText2 加粗,而不是 sECText1 或 sECText3。 感谢您的帮助!

【问题讨论】:

  • 好吧,也许有点麻烦或者只是更好的编程,恐怕我真的不知道,但这给了我我需要的东西...... oParagraph.Range.Select Selection.TypeText ( sContent) Selection.TypeText (sPreviewLetter) Selection.TypeText (sECText1) Selection.Font.Bold = True Selection.TypeText (sECText2) Selection.Font.Bold = False Selection.TypeText (sECText3)
  • 一旦我的 8 小时结束,我会尽量记住添加这个作为答案!!!我敢肯定延迟是有充分理由的。 ;)

标签: vba ms-access ms-word ms-access-2010 word-2010


【解决方案1】:

好吧,也许有点麻烦或者只是更好的编程,恐怕我真的不知道,但这给了我我需要的东西......

oParagraph.Range.Select Selection.TypeText (sContent) Selection.TypeText (sPreviewLetter) Selection.TypeText (sECText1) Selection.Font.Bold = True Selection.TypeText (sECText2) Selection.Font.Bold = False Selection.TypeText (sECText3)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-17
    • 2017-06-12
    • 2012-02-21
    • 1970-01-01
    相关资源
    最近更新 更多