I take it that you want this template to apply to whoever uses it rather
than for your personal use?
The following macro will read and enter the current user's name and e-mail
address from Outlook at a bookmark location "Email" or at the cursor if that
location does not exist. You will need to add the Outlook object library to
the vba editor tools > references.
Sub InsertCurrentUsersEmailAddress()
Dim olook As Outlook.Application
Dim sEAddress As String
Dim sEName As String
Dim bStarted As Boolean
On Error Resume Next
Set olook = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set olook = CreateObject("Outlook.Application")
bStarted = True
End If
sEAddress = olook.Session.CurrentUser.Address
sEName = olook.Session.CurrentUser.name
' Close Outlook if it was started by this macro.
If bStarted Then
oOutlookApp.Quit
End If
With Selection
.GoTo What:=wdGoToBookmark, name:="EMail"
.TypeText Text:=sEName & vbTab & sEAddress
End With
End Sub
http://www.gmayor.com/installing_macro.htm
Obtaining the title is rather more complicated as the user's title is not
stored in Word or Outlook. I suppose it would be possible to write code to
populate custom document property fields and read those into the document,
but it all starts to get a tad complicated if the template is to be shared.
See also
http://www.gmayor.com/Macrobutton.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>