What I did is that I make different template for each group. For your example, one template is for Canadian. Another is for US. (Duplicate Canadian template to be US template and change to Canadian's logo to US's logo)
The following is the code that I did for my project. If Student are in third grade, it shows third grade template. If they are fourth grader, it pulls fourth grade template. In my data, I have a column that explains which template is required.
Sample Data
StudentID Grade Template ....
--------- ----- ----------
3424 3 3rd.docx
4424 4 4th.docx
3198 3 3rd.docx
VBA code:
Public Sub Print_Student_Report_by_St_ID(StudentID_in As Long, _
Optional TemplateName_in As String, _
Optional TemplatePath_in As String, _
Optional DisplayWord_in As Boolean)
On Error GoTo ErrorHandler
Dim this_path As String
Dim this_db As String
Dim strTemplateFileName As String
Dim strTemplatePath As String
'Folder Location
this_path = Application.CurrentProject.Path & "\"
this_db = this_path & Application.CurrentProject.Name
'Find Template
strTemplatePath = TemplatePath_in
strTemplateFileName = TemplateName_in
'Convert St_ID to SQL Statement
Dim ssql As String
ssql = SELECT_SOMETHING
Dim word_app As Word.Application
Set word_app = CreateObject("Word.Application")
If DisplayWord_in Then
word_app.Visible = True
Else
word_app.Visible = False
End If
Dim word_doc As Word.Document
Set word_doc = word_app.Documents.Open(TemplatePath_in & strTemplateFileName)
If word_doc.MailMerge.State <> wdMainAndDataSource Then
With word_doc.MailMerge
'Add UserName and Password to prevent it ask password everytime if not user windows logon password
Dim strConnection As String
strConnection = "Provider=SQLOLEDB.1;Initial Catalog=database_name;" _
& "Data Source=domain.com;" _
& "UID=user;PWD=password;"
.OpenDataSource _
Name:=this_db, _
ReadOnly:=True, LinkToSource:=True, _
SQLstatement:=ssql, Connection:=strConnection
.Destination = wdSendToPrinter
.Execute
End With
End If
Exit_Sub:
word_doc.Close SaveChanges:=wdDoNotSaveChanges
word_app.Quit wdDoNotSaveChanges
Set word_doc = Nothing
Set word_app = Nothing
Exit Sub
ErrorHandler:
Select Case Err.Number
Case 0
Case Else
'Show Some Error
End Select
Resume Exit_Sub
Resume
End Sub
But disadvantage is if you have too many groups. You may need a bunch of templates, which are hard to maintain.