Email address as autotext

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a normal template that I share with all the users on the network,
approx 50 of them. In the Word template, we have a header and a footer, as
of now in the footer we have an info@ email address, I would like to change
this so the the option is actually filled in with the users email address
that is opening the template. We are running SBS2003 and Word 2002, as well
as AD. Is there any scripting I can do?

Thanks
 
Normal.dot is an individual user file and must not be shared!
You should not have headers and footers in the normal.dot template as this
screws up some other documents such as labels.
Use shared document templates for your documents
http://www.gmayor.com/Template_Locations.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Fortunately it is not the normal.dot template that I am using. It is a
custom template. Therefore I do not have to worry about that, but thanks for
the info.
 
That's a relief - you did say that "I have a normal template that I share
with all the users "
If you can ensure that all your users have an autotext entry called email
which contains their e-mail address in their own normal.dot files, an
autotext field in your shared template will pick it up whenever a new
document is created from that template.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Graham Mayor said:
That's a relief - you did say that "I have a normal template that I share
with all the users "
If you can ensure that all your users have an autotext entry called email
which contains their e-mail address in their own normal.dot files, an
autotext field in your shared template will pick it up whenever a new
document is created from that template.
Excellent. Thank you

Question, is there a way that I do not have to have user interaction in
order to do this? I was hoping I would be able to pull the email address
from the address book in outlook or ad and put it in there automatically for
them.

Scenario:

If I point everyone's default template directory (in GPO) to a server shared
template directory, would I not be able to use a hidden normal.dot template
in the shared folder that had a built in vb script or autotext or something
to query AD for username, then I would be able to cross link the normal.dot
to the what a user calls up such as letterhead.dot and the script or autotext
would be able to paste the users login/email into the field.

May be a little off to the left, but if you could let me know or point me
theway that would be great.

Thanks for the help
 
If they are all using Outlook then you can pull the information from
Outlook. If they are not all using Outlook, it gets a lot more complicated
and frankly not worth the effort. Fellow MVP Doug Robbins recently posted
this basis for this code which will insert the user's e-mail address from
Outlook at a pre-positioned bookmark 'EMail'.

Only snag is that Outlook will pop up a security warning when accessed for
this information, which the users may not appreciate :(

Sub AddEmail()
Dim olook As Outlook.Application
Dim sEAddress 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
' 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:=sEAddress
End With
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top