Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karol Brown - 28 Mar 2005 18:38 GMT
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
Greg - 28 Mar 2005 21:04 GMT
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
Graham Mayor - 29 Mar 2005 08:42 GMT
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)

Signature

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> 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
[quoted text clipped - 6 lines]
>
> Karol
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.