You could test the macro against the name of the document (or save the document as DOCX format and it will not have a macro).
In the case of the former, let's assume a docvariable field that displays the docvariable "varDate", which to demonstrate has a value that is the current time.
The following macro saved in the ThisDocument module will only run if the document containing the macro is called 'docname.docm'
Code:
Option Explicit
Private Sub Document_Open()
Dim oFld As Field
If ThisDocument.Name = "docname.docm" Then
For Each oFld In ThisDocument.Fields
If oFld.Type = wdFieldDocVariable Then
If InStr(1, oFld.Code, "varDate") > 0 Then
oFld.Locked = False
ThisDocument.Variables("varDate").Value = Format(Time, "hh:mm:ss")
oFld.Update
oFld.Locked = True
Exit For
End If
End If
Next oFld
End If
lbl_Exit:
Exit Sub
End Sub