Replace the field with a text content control titled "PageNum" and use the following macro to populate/update it:
Code:
Sub UpDatePageNum()
Dim oCC As ContentControl
Set oCC = ActiveDocument.SelectContentControlsByTitle("PageNum").Item(1)
oCC.Range.Text = oCC.Range.Information(wdActiveEndPageNumber)
Set oCC = Nothing
End Sub
If you have more than one such field in the body of the text then replace each of them with a content control titles PageNum and use the following code to populate/update them all:
Code:
Sub UpDatePageNum()
Dim oCC As ContentControl
For Each oCC In ActiveDocument.Range.ContentControls
If oCC.TITLE = "PageNum" Then
oCC.Range.Text = oCC.Range.Information(wdActiveEndPageNumber)
End If
Next oCC
Set oCC = Nothing
End Sub
You may find
Insert Content Control Add-In useful