Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2017, 01:41 AM
BristolJGM BristolJGM is offline IF statement in Word VBA Windows 7 32bit IF statement in Word VBA Office 2010 32bit
Novice
IF statement in Word VBA
 
Join Date: Sep 2017
Posts: 2
BristolJGM is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 09-09-2017, 02:52 AM
gmayor's Avatar
gmayor gmayor is offline IF statement in Word VBA Windows 10 IF statement in Word VBA Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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.
Attached Files
File Type: docm Questions.docm (36.2 KB, 21 views)
File Type: docx Answers.docx (21.8 KB, 15 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 09-16-2017, 06:02 AM
BristolJGM BristolJGM is offline IF statement in Word VBA Windows 7 32bit IF statement in Word VBA Office 2010 32bit
Novice
IF statement in Word VBA
 
Join Date: Sep 2017
Posts: 2
BristolJGM is on a distinguished road
Default

Thank you, this is just what I had in mind. Looks like I have some reading up to do on user forms...!
Reply With Quote
Reply



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
IF statement in Word VBA 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
IF statement in Word VBA Help with IF Statement limpbizkit Excel 4 02-24-2011 09:16 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:52 AM.


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