差し込み印刷で、文字数によりフォントサイズを変更する(その2)

 

エクセル側で、データフィールドを追加する必要の無い

フィールドコードが判りましたので再度ご連絡します。

フィールドコード

{ IF { MEREGFIELD 会社名} = "??????????*" { MEREGFIELD会社名 \* Charformat } { IF { MEREGFIELD会社名} = "?????*" { MEREGFIELD会社名 \* Charformat } { MEREGFIELD 会社名 \* Charformat} } }

注:

?’ :1文字を意味します。

*’ :任意の文字数の文字列を意味します。

従って、

"??????????*" :10文字または、それ以上の文字数の文字列の長さを示します。

尚、

{ MEREGFIELD 会社名 \* Charformat}

{ MEREGFIELD 会社名 \* Charformat}

{ MEREGFIELD 会社名 \* Charformat}

これらは、上から順に、先頭の「M」のフォントサイズを

8pt

10pt

12pt

に設定しています。

また、特に、この部分は、

[差し込みフィールドの挿入]で、一旦挿入した後、

Alt]+[F9]ファンクションキーで、フィールドコードの表示にして、

\* Charformat

を入力すると、

「エラー、ブックマークが定義されていません。」というエラーは回避出来ます。

\* Charformat

は、一般書式スイッチで、

フィールドコードの先頭の文字に書式を設定した場合に、

その先頭文字の書式を実行結果全体に設定します。

+++

原文

Hi Harry,

Your fields are lacking the \* Charformat switches, which youd need to make them work. Apart from that, what youve described is pretty much how youd have to do this with a Word mailmerge, as Word has no field codes for string manipulation.

That said, you dont really need to have the extra data field in the source. Instead, in Word, you could use something like:

{ IF { MEREGFIELD Fieldname } = "??????????*"{MEREGFIELD Fieldname \* Charformat} { IF { MEREGFIELD Fieldname} = "?????*"{ MEREGFIELD Fieldname \* Charformat } {MEREGFIELD Fieldname \* Charformat} } }

with just the M formatted in the desired font. You can nest more levels if you want the above is just for demonstration. Each ? represents a character and * represents a string of any number of characters, so "??????????*" specifies a string length of 10 or more characters.

Cheers,

Paul Edstein

(aka macropod)

+++

IF文の入れ子式の構造(構文はそれぞれ半角スペースで区切ります)

IF 基本条件式 一致 基本不一致

基本不一致の内部構造

>第1不一致の入れ子式

 IF 第2条件式 一致 第2不一致

>>第2不一致の入れ子式

  IF 第3条件式 一致 第3不一致

>>>第3不一致の入れ子式

   IF 第4条件式 一致 第4不一致

+++

基本

IF データフィールド名1条件式 一致}基本不一致}}

第1不一致

IF {データフィールド名} 第2条件式{一致} {第2不一致}

2不一致

IF {データフィールド名} 第3条件式{一致} {第3不一致}

3不一致

IF {データフィールド名} 第4条件式{一致} {第4不一致}

4不一致

IF {データフィールド名} 第5条件式{一致} {第5不一致}

++

IF データフィールド名1条件式 一致}IF {データフィールド名} 第2条件式 {一致} {IF {データフィールド名} 第3条件式{一致} {IF {データフィールド名} 第4条件式{一致} {IF {データフィールド名} 第5条件式{一致} {第5不一致}}}}}}