In the template, you could save a macro named AutoNew and let the macro
display the header with the bookmark selected. However, I suggest another
approach that automatically inserts the user name. This requires that you can
rely on the name defined in Tools > Options > User Information tab being
correct.
You could then insert the AutoNew macro below in the template - the macro
will run when a new document is created, based on that template. In the
macro, change "UserName" to the name of your bookmark - the macro will
automatically update the bookmark with the currently defined user name:
Sub AutoNew()
Dim oRange As Range
Dim strBkmName As String
strBkmName = "UserName"
'To prevent error if bookmark is missing, check first
If ActiveDocument.Bookmarks.Exists(strBkmName) Then
Set oRange = ActiveDocument.Bookmarks(strBkmName).Range
'Insert the user name
oRange.Text = Application.UserName
'The bookmark is gone - recreate it
ActiveDocument.Bookmarks.Add strBkmName, oRange
Else
'What to do if the bookmark was not in the template?
'Insert code here
End If
'Clean up
Set oRange = Nothing
End Sub
If you cannot rely on the defined user name, you could change the macro so
that it displays an inputbox, asking about the user name. Please post back in
case you need an inputbox and need help on the VBA code.
For help on installing a macro, see:
http://www.gmayor.com/installing_macro.htm
--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word