#1
|
|||
|
|||
IF statement in Word VBA
Hello
I'm pretty new to using VBA in Word although I do have some (limited) experience in Excel. What I'm looking to do is to have two documents. Document 1 would be a list of questions. Document 2 will be populated based on the answers to the questions. So, for example, if the answer to question 1 is "yes" then a particular form of wording would be used on page 1 of document 2 (it isn't just a question of pasting the "yes" response from Document 1 into Document 2). The idea would be to take a completed questionnaire and then run a macro which would auto-complete Document 2. At a very high level, is it feasible to do this in Word VBA and can anyone give me some very high level pointers on how I might go about it? Thanks! |
#2
|
||||
|
||||
There are various ways to do this e.g. Let's assume that the questions take the form of combobox content controls and the answers are placed at bookmarked locations then you could write the appropriate text based on the answer to the answers document. At its simplest see the attached. Put both docs in the same folder and open the questions document. Select an answer and click outside the content control.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Thank you, this is just what I had in mind. Looks like I have some reading up to do on user forms...!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
and if statement in word mailmerge | sbye | Mail Merge | 17 | 08-25-2017 09:59 PM |
VBA Word - Find & Apply Styles to Specific Words - Using Case Statement | jc491 | Word VBA | 17 | 12-26-2015 12:25 PM |
Microsoft Word IF statement issues | micro44 | Word | 4 | 10-23-2014 12:10 PM |
Help with IF statement in word 2010 | Mad | Word | 2 | 04-06-2013 06:31 AM |
Help with IF Statement | limpbizkit | Excel | 4 | 02-24-2011 09:16 PM |