If the column title in Excel is "StudentID" then try "<StudentID>" (without quotes).
If you know what the MergeField is called (which can be different from the column title in Excel) then just add the chevrons.
With your letter open press Alt+F11 and double click "ThisDocument" in the window that opens (it should be near the top left in a pane called "Project - Project").
Paste the entire code into the blank pane that opens and save. Close the Visual Basic Editor and the Word document and re-open the...
Thanks!
Bear in mind that it will error if you try to merge to another destination (printer etc)
You can wrap the code within the subs with:
If ActiveDocument.MailMerge.Destination = wdSendToEmail Then
End ifto avoid this.
For anyone else looking for the answer Try:
Dim WithEvents wdapp As Application
Dim EMAIL_SUBJECT As String
Dim FIRST_RECORD As Boolean
Private Sub Document_Open()
Set wdapp = Application
ThisDocument.MailMerge.ShowWizard 1
End Sub
Private Sub Document_Close()
Set wdapp =...