搜尋此網誌

2017年10月13日 星期五

MS word功能變數的應用,功能變數的英文是field code

MS word功能變數的應用問題(每個子題在下方均有說明)
  1. 大家知道「功能變數」 ,「合併列印」的英文是什麼嗎??
  2. 簡單記錄一下功能變數if的應用
  3. 如果if中的條件有兩個的話要如何做呢?
  4. 如何讓沒有值的功能變數不印出空白行?
  5. 如何在「合併列印」使用「功能變數」時可以自動編號?
  6. 所有功能變數的語法
---------------------------------------------------------------
大家知道「功能變數」 ,「合併列印」的英文是什麼嗎??
  • 「功能變數」field code 是的就是field code,如此找英文資料就比較好找啦!!
  • 「合併列印」的英文是mail merge
這篇要簡單記錄一下功能變數if的應用,如果if中的條件有兩個的話要如何做呢? (實作過喲~~)
  • {IF { = OR({COMPARE{MERGEFIELD "Field_A"} = 0}, {COMPARE{MERGEFIELD "Field_B"} = "ABC_TEXT"} )} = 1 "Show成立" "Show條件不成立"}
  • {IF { = AND({COMPARE{MERGEFIELD "Field_A"} = 0}, {COMPARE{MERGEFIELD "Field_B"} = "ABC_TEXT"} )} = 1 "Show成立" "Show條件不成立"}
重點來了,多條件怎麼處理? 也許這個可以處理:
  • {IF { = {if {MERGEFIELD "Field_A"} = 0 10} + {IF {MERGEFIELD "Field_B"} = 0 10} + {IF {MERGEFIELD "Field_C"} = 0 10}} = 30 "PASS" "FAIL"}
這個最厲害...

參考macropod [Microsoft MVP - Word]寫的

You can build a multiple AND test this way:
{IF{={IF{MERGEFIELD 1}= "Y" 1 0}*{IF{MERGEFIELD 2} 2 1 0}*{IF{MERGEFIELD 3}= "text" 1 0}}= 1 "True Text" "False Text"}

Similarly, you can build a multiple OR test this way:
{IF{={IF{MERGEFIELD 1}= "Y" 1 0}+{IF{MERGEFIELD 2} 2 1 0}+{IF{MERGEFIELD 3}= "text" 1 0}} > 0 "True Text" "False Text"}

https://answers.microsoft.com/en-us/office/forum/office_2013_release-word/is-there-a-limit-to-word-2013-and-and-or/6e47059c-e851-4ac6-8750-ad58e4fd8e80?auth=1

有個老師的網站很棒,有教學~~~必看
http://thinker-evans.blogspot.tw/2014/09/office-word-200720102013_21.html

實用

如何讓沒有值的功能變數不印出空白行? 例如下面範例使用了\f switch,如果變數street_address2沒有值,它不會印出空白行,在實務上非常好用的~~~請注意下方黃色標示的說明,也可同時前加字後也加字 感謝熱心網友的PO文「Mail Merge Switches

Selective Line Break Insertion
Use \b and \f switches to insert line breaks when needed.
\b - Specifies the text to be inserted before the MERGEFIELD field if the field is not blank.
\f - Specifies the text to be inserted following the MERGEFIELD field if the field is not blank.
EXAMPLE
{MERGEFIELD street_address1}
{MERGEFIELD street_address2 \f "↲"}
{MERGEFIELD city}, {MERGEFIELD state} {MERGEFIELD zip}
 
Replace  with an actual line break (Shift-Enter)
If all fields are not blank, the result will be
123 Main
MS 123
Any Town, CA 00000
If street_address2 is blank, the result will be
123 Main
Any Town, CA 00000
Without the \f switch, there would be an empty line between street_address1 and the city/state/zip line.

請參考以下網址也有詳細說明:
Office 2010 Don't print blank lines when data fields are empty

如何在「合併列印」使用「功能變數」時可以自動編號?

可能自動編號的,使用SEQ功能變數

https://www.youtube.com/watch?v=IPuIcxXux-4
https://support.office.com/en-us/article/seq-sequence-field-062a387b-dfc9-4ef8-8235-29ee113d59be
https://stackoverflow.com/questions/33797829/ms-word-mailmerge-autonumbering-for-mergefield


參考資料

List of field codes in Word (所有功能變數的語法)

2017年9月18日 星期一

在WORD中,如何限制一行只能輸入固定的字數How to Limit the Characters Per Line in Microsoft Word

在一篇文章中若規定每一行只能70個字,在ms word中會怎麼做呢??

重點是:要視你規定每一行的字數是以純中文字或純英文字來計算而不一樣。

中文版的word如規定每一行中文字的字數,那就簡單了,就暫不介紹了。

今天要設定的是純英文的,如果規定一行限制60個英文字,這樣要如何設定呢?

1.開啟一個新word文件

2.設定字型成Courier New、 Monaco or Andale Mono

3.字型大小為12

4.算計欄寬:因為12號字在1 inch中可以放入10個字,而此案例要求一行要60個英文字,所以欄寬=60 / 10 = 6 inch,所以請調整左右邊界,使欄寬成為6 inch。

5.設定下圖
6.設定下圖

完工。

可參考其它網友的解如下:
http://www.ehow.co.uk/how_8296948_limit-per-line-microsoft-word.html

Double-click the Microsoft Word application icon to launch the application. Click the arrow to the right of the assigned font in the font menu bar and select a monospaced font from the drop-down menu. Courier, Courier New, Monaco and Andale Mono are a few examples of monospaced fonts.
Click the arrow to the right of the assigned font size and select "12" from the font size drop-down menu. The font size 12 allows 10 characters per inch, making it easy to limit the amount of characters per line.
Use the equation "Characters per line / characters per inch = Print area in inches" to determine the amount of print area required to limit the amount of characters per line. For example, if you want 60 characters per line, the equation would be "60 / 10 = 6 inches."
Subtract the number obtained in Step 3 from 8.5 and divide the resulting number by 2. The resulting number is the required width of the document's left and right margins. For the example, "8.5 - 6 = 2.5" and "2.5 / 2 = 1.25." The left and right margins for the example document would both be 1.25 inches.
Click the "Layout" tab. In the space labelled "Left" beneath the "Margins" heading, type the margin size obtained in Step 4 and press the "Enter" key. In the space labelled "Right" beneath the "Margins" heading, type the margin size obtained in Step 4 and press the "Enter" key. Each line of the document will now be limited to the desired number of monospaced characters.