Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
blwrs blwrs is offline
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
If then statements LSivak Mailmerge 1 November 9th 06 12:17 AM
there are too many context menues Timothy Microsoft Word Help 7 May 28th 06 04:19 AM
help with dropdown menues NoLegs New Users 1 May 9th 06 02:18 AM
Modify dropdown menues - 2003 Mia Microsoft Word Help 2 April 28th 05 08:18 AM
Shortcut Menues (right-click) Sally Sibthorpe Microsoft Word Help 3 January 24th 05 08:56 PM


All times are GMT +1. The time now is 04:47 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"