Automatically fill in phone number based on person chosen in dropdown box

  • Thread starter Karol Brown via OfficeKB.com
  • Start date
K

Karol Brown via OfficeKB.com

Hi. I am creating form templates for an office, where individuals can
choose who the letter will be signed by. I would like to have the form
automatically fill-in that person's phone number based on the selection of
the person in the formdropdown box. Does anyone have a simple way of doing
this? I was thinking that a series of nested IF statements could work, but
thought that there may be an easier way.

Thanks in advance for any suggestions or ideas,

Karol
 
G

Greg

Karol,

Unless something better comes along I would use the recently grasped
(by me) Select Case method:
Sub FillInPhoneNum()
Dim oDoc As Document
Dim sigName As String
Set oDoc = ActiveDocument
sigName = oDoc.FormFields("Dropdown1").Result
Select Case sigName
Case "Janet"
oDoc.FormFields("Text1").Result = "XXX-1234"
Case "Bill"
oDoc.FormFields("Text1").Result = "XXX-1235"
Case "Bob"
oDoc.FormFields("Text1").Result = "XXX-1236"
Case Else
oDoc.FormFields("Text1").Result = "N/A"
End Select
End Sub

run on exit from the dropdown1 formfield
 
G

Graham Mayor

Alternatively, you could investigate - http://www.gmayor.com/SelectFile.htm
and use the method to insert autotext entries (which could include a graphic
of the signature if required)

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


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

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

Top