In that case, the SELECT FROM statement becomes:
SELECT [#] AS `FER`, `Year`, [InstrumentNo ] AS `Instrument No`, `Date`, `Terms`, `CCY`, Format([Amount],'#,0') AS `Amount` FROM
And, for the switches use:
\l "1" \b "16" \h
As for the centering & header row formatting, add the following macro in your mailmerge main document to drive the process:
Code:
Sub MailMergeToDoc()
Application.ScreenUpdating = False
Dim Tbl As Table
ActiveDocument.MailMerge.Execute
With ActiveDocument
For Each Tbl In .Tables
With Tbl
.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Rows.Alignment = wdAlignRowCenter
.Rows(1).HeadingFormat = True
.Rows(1).Range.Font.Bold = True
.Rows(1).Range.Shading.BackgroundPatternColor = wdColorAqua
End With
Nexxt
End With
Set Tbl = Nothing
Application.ScreenUpdating = True
End Sub
Clicking on the 'Edit Individual Documents' button in Word will intercept the merge and run the macro automatically. The potential disadvantage of intercepting the merge this way is that you no longer get to choose which records to merge at that stage. However, you can still achieve the same outcome - and with greater control - via the 'Edit Recipient List' tools.
I haven't been able to match your exact shading using Word's presets. The full set of presets for blue shades of various kinds are:
wdColorAqua, wdColorBlue, wdColorBlueGray, wdColorLightBlue, wdColorLightTurquoise, wdColorPaleBlue, wdColorSkyBlue, wdColorTeal, wdColorTurquoise
Other than using one of those, you could use:
Code:
.Rows(1).Range.Shading.BackgroundPatternColorIndex =
with the numeric value or RGB values of the color you want.
Note: You will need to save your mailmerge main document in the .docm format.
For PC macro installation & usage instructions, see:
Installing Macros
For Mac macro installation & usage instructions, see:
https://wordmvp.com/Mac/InstallMacro.html