Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-25-2015, 07:53 AM
jingles9 jingles9 is offline macros and references in Word 2007 letter Windows 7 32bit macros and references in Word 2007 letter Office 2007
Novice
macros and references in Word 2007 letter
 
Join Date: Sep 2015
Posts: 4
jingles9 is on a distinguished road
Default macros and references in Word 2007 letter

Hello, I am writing a letter that has two drop down fields. Depending on the item selected it references another section of the letter to automatically input data.
i.e in my letter you select the employee's name (dropdown2) and company (dropdown 1) and then it will prepopulate their email. Most employees are First.Last@companya, First.Last@companyc and First_Last@companyb however; one employee "Donald Duck" is First.Last for all three companies. Does anyone know what code I need to type for this?



The code I am currently using is:
{if{ Dropdown2}= "Mickey Mouse""Mickey"""}{if{ Dropdown2}= "Minnie Mouse""Minnie"""}{if{ Dropdown2}= "Donald Duck""Donald"""}{if{ Dropdown1}= "Company B""_""""}{if{ Dropdown1}= "Company A""."""}{if{ Dropdown1}= "Company C""."""}{if{ Dropdown2}= "Mickey Mouse""Mouse"""}{if{ Dropdown2}= "Minnie Mouse""Mouse"""}{if{ Dropdown2}= "Donald Duck""Duck"""}"""}{if{ Dropdown1}= "Company B""@companyb.com""""}{if{ Dropdown1}= "Company A""@companya.com."""}{if{ Dropdown1}= "Company C""@companyc.ca"""}

any suggestions?
Attached Files
File Type: docx TEST No personal data letter.docx (14.3 KB, 12 views)
Reply With Quote
  #2  
Old 09-25-2015, 04:30 PM
macropod's Avatar
macropod macropod is offline macros and references in Word 2007 letter Windows 7 64bit macros and references in Word 2007 letter Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
{If{REF Dropdown2}= "Donald Duck" "Donald.Duck{If{REF Dropdown1}= "Company B" "@companyb.com"}"}{If{REF Dropdown2}= "Mickey Mouse" {If{REF Dropdown1}= "Company B" "Mickey_Mouse@companyb.com" "Mickey.Mouse"}}{If{REF Dropdown2}= "Minnie Mouse" {If{REF Dropdown1}= "Company B" "Minnie_Mouse@companyb.com" "Minnie.Mouse"}}{If{REF Dropdown1}= "Company A" "@companya.ca" {If{REF Dropdown1}= "Company C" "@companyc.ca"}}

Note: This has nothing to do with macros - it concerns only field coding.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-28-2015, 06:38 AM
jingles9 jingles9 is offline macros and references in Word 2007 letter Windows 7 32bit macros and references in Word 2007 letter Office 2007
Novice
macros and references in Word 2007 letter
 
Join Date: Sep 2015
Posts: 4
jingles9 is on a distinguished road
Default

Hi Paul...I tried copying/pasting the coding you provided but it isn't working for me. I'm fairly new at this and I'm not sure if it is the coding that isn't working, or something I did? Would you be able to add it to the file I uploaded and I can cross reference it with what I have?
Reply With Quote
  #4  
Old 09-28-2015, 10:47 AM
Charles Kenyon Charles Kenyon is offline macros and references in Word 2007 letter Windows 8 macros and references in Word 2007 letter Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,533
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Every pair of braces { } needs to be inserted by using Ctrl+F9. You can't simply type them. They must be inserted in pairs.
Using Fields in Microsoft Word
Reply With Quote
  #5  
Old 09-28-2015, 12:14 PM
jingles9 jingles9 is offline macros and references in Word 2007 letter Windows 7 32bit macros and references in Word 2007 letter Office 2007
Novice
macros and references in Word 2007 letter
 
Join Date: Sep 2015
Posts: 4
jingles9 is on a distinguished road
Default

I did use CtrlF9 to put the brackets in. When I lock the sheet to test the coding Donald Duck and Mickey mouse both work properly but the third name , Minnie Mouse, does not pre-fill like it should.
Reply With Quote
  #6  
Old 09-29-2015, 03:51 AM
macropod's Avatar
macropod macropod is offline macros and references in Word 2007 letter Windows 7 64bit macros and references in Word 2007 letter Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try the attached.
Attached Files
File Type: docx No personal data letter.docx (16.3 KB, 10 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 09-29-2015, 04:52 AM
jingles9 jingles9 is offline macros and references in Word 2007 letter Windows 7 32bit macros and references in Word 2007 letter Office 2007
Novice
macros and references in Word 2007 letter
 
Join Date: Sep 2015
Posts: 4
jingles9 is on a distinguished road
Default

This works perfectly. Thank you so much!!!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can someone please help? Cross-references have stopped working in Word 2007 WaltR Word 1 12-18-2014 05:28 PM
How to fix/edit corrupted References in Word 2007 XP sv pk 3 Hyper-Energy Bob Word 3 07-08-2014 02:00 PM
macros and references in Word 2007 letter How do I change Excel Chart Object link references from UNC to drive letter? SusieBennett Word 9 06-16-2014 05:58 PM
macros and references in Word 2007 letter Word 2007 References When Adding Text From File grantgibson45 Word 1 07-04-2012 07:16 AM
Caption woes with cross-references/TOFs (Word 2007) Jhimmibhob Word 0 07-27-2011 08:37 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft