WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Email form based on drop down value

 
   Home -> Office -> Mail RSS
Next:  Printing envelopes  
Author Message
Sabosis

External


Since: Aug 11, 2008
Posts: 5



(Msg. 1) Posted: Mon Aug 11, 2008 2:15 pm
Post subject: Email form based on drop down value
Archived from groups: microsoft>public>word>mail (more info?)

Hello-

I want to have a drop down field in a form that has an employees
location, like "city A", "city B", "city C", etc. When filling out the
form, the rep will select their location. On the bottom of the form is
a "submit" button that will automatically send the email (I have this
step in action right now).

What I want to do is to have the code for the "submit" button
reference the drop down value to see who needs to be emailed.

If the value of the drop down is city A, the form emails to
joe.smith DeleteThis @mycompany.com, if the value is city B, the form emails
jane.doe DeleteThis @mycompany.com, etc

Can this be done? Thanks in advance for the help.

Scott
Back to top
Login to vote
Doug Robbins - Word MVP

External


Since: Jul 14, 2006
Posts: 5475



(Msg. 2) Posted: Tue Aug 12, 2008 6:26 pm
Post subject: Re: Email form based on drop down value [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Assuming that by a drop down field you mean a DropDown FormField as used in
a document that is Protected for forms, have a macro that contains the
following code run on exit from the DropDown FormField:

Dim i As Long
Dim City As String, emailaddress As String
With ActiveDocument.FormFields("City").DropDown
i = .Value
City = .ListEntries(i).Name
End With
Select Case City 'Change the cases and the email addresses to suit
Case "New York"
emailaddress = "someone@newyork"
Case "Buffalo"
emailaddress = "someone@buffalo"
Case "Chicago"
emailaddress = "someone@chicago"
End Select
MsgBox emailaddress 'Use emailaddress in your code that sends the form.


--
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

"Sabosis" <scott.sabo RemoveThis @henryschein.com> wrote in message
news:178220b2-8361-4216-b6d9-2e2df9b6c663@k37g2000hsf.googlegroups.com...
> Hello-
>
> I want to have a drop down field in a form that has an employees
> location, like "city A", "city B", "city C", etc. When filling out the
> form, the rep will select their location. On the bottom of the form is
> a "submit" button that will automatically send the email (I have this
> step in action right now).
>
> What I want to do is to have the code for the "submit" button
> reference the drop down value to see who needs to be emailed.
>
> If the value of the drop down is city A, the form emails to
> joe.smith RemoveThis @mycompany.com, if the value is city B, the form emails
> jane.doe RemoveThis @mycompany.com, etc
>
> Can this be done? Thanks in advance for the help.
>
> Scott
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> Mail All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET