Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
If statements and drop down menues 03
I'm using word 2003. I currently have a dropdown menu named "Dropdown1"
which lists the names of some project foreman. I would like to set up another area on my paper which automatically inserts each foremans phone number when his/her name is selected from the drop down list. I have not been able to make this work. please help! Also i'm by no means a Word expert so you will have to really walk me through it. "go to here", "select this" that kind of information would be great. thank you. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
If statements and drop down menues 03
There are a number of ways to do this, but none of them particularly simple
for a non-expert. One reasonably simple way is to create autotext entries with the name of each foreman each of which contains the phone number. Then you would have the following macro run on exit from the DropDown formfield Sub GetPhone() Dim myDrop As DropDown Dim Foreman As String, PhoneNum As String Set myDrop = ActiveDocument.FormFields("Foremen").DropDown Foreman = myDrop.ListEntries(myDrop.Value).Name Foreman = Mid(Foreman, InStr(Foreman, " ") + 1) PhoneNum = ActiveDocument.AttachedTemplate.AutoTextEntries(Fo reman).Value ActiveDocument.FormFields("PhoneNumber").Result = PhoneNum End Sub It assumes that the DropDown that contains the names of the foremen has the bookmark name of "Foremen" assigned to it and that there is another formfield with the bookmark name of "PhoneNumber" in which the phone number is to be displayed. It also assumes that your drop down contains the first and the last name of each foreman and that the names of the autotext entries are the last names of the foremen. For information on setting a macro to run on exit from a formfield, see: http://www.mousetrax.com/techpage.html#autoforms To learn what to do with the code provided above, see the article "What do I do with macros sent to me by other newsgroup readers to help me out?" at: http://www.word.mvps.org/FAQs/Macros...eateAMacro.htm If you happen to have two foremen with the same last name, the above method will not be satisfactory -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "blwrs" wrote in message ... I'm using word 2003. I currently have a dropdown menu named "Dropdown1" which lists the names of some project foreman. I would like to set up another area on my paper which automatically inserts each foremans phone number when his/her name is selected from the drop down list. I have not been able to make this work. please help! Also i'm by no means a Word expert so you will have to really walk me through it. "go to here", "select this" that kind of information would be great. thank you. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
If statements and drop down menues 03
As an alternative to Doug's method you could insert the same autotext
entries by using an autotext field To clarify, let's say that you have three foremen "Bill" "John" & "Fred" and that these are the names as they appear in the dropdown field. Check the calculate on exit checkbox of the dropdown field. Save the details for each of the foreman with autotext names that are identical to the names as they appear in the dropdown - so far this is the same as what Doug suggested. Where you want the information from the autotext entries reproduced insert an autotext field eg { Autotext "{ Dropdown1 }" } When you tab out of the dropdown field the autotext field will be updated with the associated information. If you wish to associate more than one piece of information with each foreman then create a second autotext entry for each only this time add a character to the autotext name eg BillA, JohnA, & FredA You can then insert the second piece of information using another Autotext field i.e. in this instance { Autotext "{ Dropdown1 }A" } -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org blwrs wrote: I'm using word 2003. I currently have a dropdown menu named "Dropdown1" which lists the names of some project foreman. I would like to set up another area on my paper which automatically inserts each foremans phone number when his/her name is selected from the drop down list. I have not been able to make this work. please help! Also i'm by no means a Word expert so you will have to really walk me through it. "go to here", "select this" that kind of information would be great. thank you. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If then statements | Mailmerge | |||
there are too many context menues | Microsoft Word Help | |||
help with dropdown menues | New Users | |||
Modify dropdown menues - 2003 | Microsoft Word Help | |||
Shortcut Menues (right-click) | Microsoft Word Help |