In a
Global Template, the following works and the variable value persists so long as the template is loaded. The code is in a standard module.
Code:
Option Explicit
Public strTest As String
Static Sub AutoExec()
Let strTest = "This is a test"
End Sub
Sub TestStringVar()
MsgBox strTest
End Sub
Here is a link to the template:
Public Variable Test.dotm
Using Document Variables is likely easier in global templates (as set forth earlier). That is what I've done in the past.