I tried writing a macro to print the last 2 page of the document of a template, but it cannot work. Any help is appreciated. Thanks.

Sub PrintAnnex()

Dim otherpage As Integer

With Application.FileDialog(msoFileDialogSaveAs)
.FilterIndex = 3
.Show

otherpage = ((ActiveDocument.ActiveWindow.Panes(1).Pages.Count) - 2)
ActiveDocument.SaveAs2 .otherpage(1), wdFormatDocument
End If
End With

End Sub