I suspect you will end up with more than one template that uses this
information once you figure out how to do it. If you are using AutoText, I
recommend putting your AutoText into a global template so that it will be
available in all of them.
I would recommend AT entry names that will not normally be typed. For
example:
Name Entry
zCKKinit CKK
zCKKname Charles Kyle Kenyon
zCKKphone (555) 123-4567
zCKKstreet 1234 Main Street, Suite 503
zCKKCSZ Anytown, MA 00000-1111
Your initial query is for three initials. These should be found at:
Application.UserInitials
Here is a sample macro to go into a global template:
Sub GetLocalInfo()
Dim tempGlobal As Template
Dim strEntryPrefix As String
Dim strName As String
Dim strStreet As String
Dim strPhone As String
Dim strCSZ As String
Set tempGlobal = Templates(ThisDocument.FullName)
strEntryPrefix = "z" & Application.UserInitials
strName = tempGlobal.AutoTextEntries(strEntryPrefix & "Name")
strStreet = tempGlobal.AutoTextEntries(strEntryPrefix & "Street")
strPhone = tempGlobal.AutoTextEntries(strEntryPrefix & "Phone")
strCSZ = tempGlobal.AutoTextEntries(strEntryPrefix & "CSZ")
MsgBox strName
MsgBox strStreet
MsgBox strCSZ
MsgBox strPhone
End Sub
It can be run from another template (once your global is properly loaded)
using:
Application.Run MacroName:= "GetLocalInfo"
This works when my user initials are "CKK" and the global template has
AutoText entries named as specified. I'll leave inserting the text where you
want it or into document properties up to you. You can find information on
inserting text at bookmarks on the MVP FAQ as well.
Final note on Global templates. You can have them on your server and have
everyone load the same template either using a shortcut or by designating
that folder as the Word Startup folder. If you do this, you'll find that you
can't edit your template when anyone has Word loaded. To get around this,
the network login script should update the template from your location to a
personal Word startup folder (on the network or on the local computer). That
way, the master global template is not locked for editing when people are
using Word.
Hope this gets you started.
--
Charles Kenyon
See the MVP FAQ: <URL:
http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.