Web、メール、印刷ドキュメントを作成するための Microsoft ワード プロセッシング ソフトウェア製品のファミリ。
世界の達人に「
小数点第二位までの表示および三桁区切りのカンマの表示をそのつど判断するようにして、
IFフィールドにMERGEFIELDフィールドを入れ子にする方法はありますか?」
と、尋ねましたが、それについては、返答頂けませんでした。
フィールドの達人から以下の返答がありました。
Mailmerge Number & Currency Formatting
差し込み印刷の数値と通貨の書式設定
To control number & currency formatting in Word, add a numeric picture switch to the mergefield. To do this:
ワード側で数値と通貨の書式を設定するには、差し込み印刷フィールドに数値書式スイッチを追加します。それには、
• select the field;
フィールドを選択します。
• press Shift-F9 to reveal the field coding. It should look something like {MERGEFIELD MyData};
[Shift]+[F9]ファンクションキーを押してフィールドコードの表示に切り替えます。そうしますと{MERGEFIELD エクセルのフィールド(項目)名 } のように表示されます。
• edit the field so that you get {MERGEFIELD MyData # $,0.00} (or whatever other numeric format you prefer - see below);
これを{MERGEFIELD エクセルのフィールド(項目)名 # $,0.00 } と編集します。(または以下に示した数値書式スイッチを必要に応じて適用します。)
• position the cursor anywhere in this field and press F9 to update it;
カーソルの位置はそのままの状態で、単独で[F9]ファンクションキーを押します。
• run your mailmerge.
差し込み印刷を続けます。
The '# $,0.00' in the field is referred to as a numeric picture switch. Other possibilities include:
# $,0.00 はフィールドの数値書式スイッチです。このスイッチは以下のように応用できます。
• # 0 for rounded whole numbers
小数点以下を四捨五入します。
• # ,0 for rounded whole numbers with a thousands separator
小数点以下を四捨五入し、三桁区切りのカンマも付します。
• # ,0.00 for numbers accurate to two decimal places, with a thousands separator
小数点以下第二位までを表示し、三桁区切りのカンマも付します。
• # $,0 for rounded whole dollars with a thousands separator
ドルの通貨マーク、小数点以下を四捨五入
• # "$,0.00;($,0.00);'-'" for currency, with brackets around negative numbers and a hyphen for 0 values
ドルの通貨マーク、負の数値の場合にはカッコで括り、ゼロの時にはハイフンを表示します。
The precision of the displayed value is controlled by the '0.00'. You can use anything from '0' to '0.000000000000000'.
小数点以下の数値をもっと正確に表示するには、0 から 0.000000000000000 までのスイッチを使います。
If you use a final ';' in the formatting switch with nothing following, (eg # "$,0.00;($,0.00);") zero values will be suppressed. Note that this suppresses 0s resulting from empty fields and from fields containing 0s.
# "$,0.00;($,0.00);" のように、「;(セミコロン)」を数値書式スイッチの最後に付けた場合、ゼロの値は非表示になります。注意点として、このゼロの非表示はエクセル側にデータが存在しない場合やデータが 0の場合です。
Mailmerge Percentage Formatting
差し込み印刷での分率の書式
To control percentage formatting in Word, add a formula and numeric picture switch to the mergefield, as follows:
• select your mergefield, which will look something like «Percent»;
• press Ctrl-F9 to wrap another field around it, thus { «Percent» };
• edit the field so that you get {=«Percent»*100 # 0.00%};
• position the cursor anywhere in this field and press F9 to update it;
• run your mailmerge.
The precision of the displayed value is controlled by the '0.00'. You can use anything from '0' to '0.000000000000000'
Note!!!: The field brace pairs (ie '{ }') for the above examples are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message. Likewise, you can't type or copy & paste the chevrons (ie '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar.
Cheers,
Paul Edstein
[MS MVP - Word]
サポート情報にも載っていない情報です。
お試し下さい。
+++
その他、英語版の参考URL
差し込み印刷フィールドの書式スイッチについて
http://www.gmayor.com/formatting\_word\_fields.htm
があります。
++
お役に立てましたでしょうか。