ms word - Format part of a Mergefield conditional text result - Stack Overflow

e.g. in Word document, say there is a section like:{ IF { MERGEFIELD SomeCondition } = "True"

e.g. in Word document, say there is a section like:

{ IF { MERGEFIELD SomeCondition } = "True" "hello there world" "" }

where { } are the special word merge field parts, which show when you press ALT+F9.
In the above, when SomeCondition is True, I want the text "hello there world" to appear. This all works well. However, is it possible to get only the word "there" above, to be displayed in bold? I tried formatting the word to be in bold in Word, but when output, it did not display in bold.

e.g. in Word document, say there is a section like:

{ IF { MERGEFIELD SomeCondition } = "True" "hello there world" "" }

where { } are the special word merge field parts, which show when you press ALT+F9.
In the above, when SomeCondition is True, I want the text "hello there world" to appear. This all works well. However, is it possible to get only the word "there" above, to be displayed in bold? I tried formatting the word to be in bold in Word, but when output, it did not display in bold.

Share Improve this question asked Mar 11 at 2:38 Moe SiskoMoe Sisko 12.1k8 gold badges52 silver badges84 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

It's way easier than that!

Simply use a field coded as:

{IF { MERGEFIELD SomeCondition } = "True" "Hello World" \* MERGEFORMAT}

You can do it by creating an Auto Text

  • Type the text in the required format in your document and then select it.
  • On the Insert tab in the Text group click Quick Parts and click on Save Selection to Quick Part Gallery ...
  • After this in your IF mergefield where you want to place the formatted text in the Quick Parts menu select Field...
  • Select Auto Text
  • In the middle part select your previously saved Auto Text member.
  • Click on OK button

You can now delete the formatted text from the document if needed.
After this the saved formatted text will appear when the condition is fulfilled.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744816596a4595362.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信