If this is a form, you could use a dropdown field to select the Branch and
run a macro to fill in other fields accordingly - a variation on the
following which puts an address in form field Text1 and a phone number in
Text2
Sub OnExitDD1()
'fills text field based on content of _
dropdown field
Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
Select Case oFld("Dropdown1").Result
Case Is = "Bristol"
oFld("Text1").Result = "1 Some Street" & vbCr _
& "Market Place" & vbCr & _
"Bristol"
oFld("Text2").Result = "123-4567"
Case Is = "London"
oFld("Text1").Result = "1 Another Street" & vbCr _
& "Some Place" & vbCr & _
"London"
oFld("Text2").Result = "911-1111"
Case Is = "Manchester"
oFld("Text1").Result = "1 Athird Street" & vbCr _
& "Yetanother Place" & vbCr & _
"Manchester"
oFld("Text2").Result = "456-9999"
Case Else
'Do nothing
End Select
End Sub
If your organisation stores the local addresses in Options > User
Information then you could insert a variety of data dependant on looking for
a unique string related to the branch e.g. the following will look in the
user address information for the City and fill in Text1 and Text2 with the
same information as above
Sub AutoNew()
'fills text field based on content of UserAddress
Dim oFld As FormFields
Dim sAddr As String
Set oFld = ActiveDocument.FormFields
sAddr = Application.UserAddress
If InStr(1, sAddr, "Bristol") Then _
oFld("Text1").Result = "1 Some Street" & vbCr _
& "Market Place" & vbCr & _
"Bristol"
oFld("Text2").Result = "123-4567"
If InStr(1, sAddr, "London") Then _
oFld("Text1").Result = "1 Another Street" & vbCr _
& "Some Place" & vbCr & _
"London"
oFld("Text2").Result = "911-1111"
If InStr(1, sAddr, "Manchester") Then _
oFld("Text1").Result = "1 Athird Street" & vbCr _
& "Yetanother Place" & vbCr & _
"Manchester"
oFld("Text2").Result = "456-9999"
End Sub
If you simply want to insert the UserAddress in Text1 you could replace all
of the latter with
Dim oFld As FormFields
Dim sAddr As String
Set oFld = ActiveDocument.FormFields
sAddr = Application.UserAddress
oFld("Text1").Result = Replace(sAddr, Chr(10), "")
You could also store the required information for each branch in an ini file
for the branch and automatically insert the information from the ini file.
See
http://www.gmayor.com/automatic_numbering_documents.htm for techniques.
There are lots of ways to approach this depending on what you have locally
or what you can set up.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>