I have a project that prints invoices using a Word .dotx template. Some invoices are multi-page and on each page I have page n of N.
However I need to print the invoice totals just on the last page where I have placed Bookmarks. I have no problem printing the totals at the Bookmarked locations.
Is there a way to compare the current page n with the total pages N and then if the last page is reached print the totals?
The code shows how I am currently printing to Bookmarks.
.Bold = -1
.Font.Size = 6
.Item("DocumentDate").Range.Text = Me.mtxtDateOfInvoice.Text
.Item("DocumentNumber").Range.Text = strInvoiceNumber
.Item("GoodsTotal").Range.Text = MyInvoiceMainDetailList(i).GoodsTotal.ToString("N2")
.Item("VATTotal").Range.Text = MyInvoiceMainDetailList(i).VATTotal.ToString("N2")
.Item("InvoiceTotal").Range.Text = MyInvoiceMainDetailList(i).InvoiceTotal.ToString("N2")