Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-07-2016, 04:16 AM
Shearvirgo Shearvirgo is offline Can Excel be used to generate a seperate Word document? Windows 10 Can Excel be used to generate a seperate Word document? Office 2013
Novice
Can Excel be used to generate a seperate Word document?
 
Join Date: Jul 2016
Posts: 5
Shearvirgo is on a distinguished road
Default Can Excel be used to generate a seperate Word document?

Hi,

I want to create a document and the content will be based on different articles of pre-defined text and only the articles that appear are the ones that are checked at the beginning.

I basically am creating a training guide but not all the information needs to be displayed for different people reading the document so I want them to be able to decide what they will see at the start of the document.



Does anyone know if this is possible? Thanks in advance.
Reply With Quote
  #2  
Old 07-07-2016, 05:17 AM
Charles Kenyon Charles Kenyon is online now Can Excel be used to generate a seperate Word document? Windows 8 Can Excel be used to generate a seperate Word document? Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,082
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

Look into AutoText and the AutoTextList field.
Automated Boilerplate Using Microsoft Word
AutoTextList field - How to add pop-up lists to any Word document, so you can click your way through changes in seconds

Otherwise, you might want to use a UserForm launched upon document creation from your template with a checklist.
Create a Simple Userform
Create & Employ a Userform
Reply With Quote
  #3  
Old 07-07-2016, 06:42 AM
Shearvirgo Shearvirgo is offline Can Excel be used to generate a seperate Word document? Windows 10 Can Excel be used to generate a seperate Word document? Office 2013
Novice
Can Excel be used to generate a seperate Word document?
 
Join Date: Jul 2016
Posts: 5
Shearvirgo is on a distinguished road
Default Thanks

Hi Charles, Many thanks for your speedy reply! I will have a look at all of these options now. One other think, If I am able to create auto text/macros, will these be usable on my PC only or will they still work if the document is saved and used on a different PC? Thanks again!
Reply With Quote
  #4  
Old 07-07-2016, 09:55 AM
Charles Kenyon Charles Kenyon is online now Can Excel be used to generate a seperate Word document? Windows 8 Can Excel be used to generate a seperate Word document? Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,082
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

Whether macros will work on another's PC depends on the rules on that PC. To have any chance, they need to be stored in your template. AutoText and other Building Blocks can only be stored in templates. Macros can be stored in either .docm or .dotm files.

For a userform to work on someone else's computer, you would use an AutoOpen macro to display the userform when a new document is created based on the template. The userform would then fill in the new document depending on the user choices, perhaps from AutoText.

AutoText, and the AutoTextList field require no macros.
Reply With Quote
  #5  
Old 07-12-2016, 04:20 AM
Shearvirgo Shearvirgo is offline Can Excel be used to generate a seperate Word document? Windows 10 Can Excel be used to generate a seperate Word document? Office 2013
Novice
Can Excel be used to generate a seperate Word document?
 
Join Date: Jul 2016
Posts: 5
Shearvirgo is on a distinguished road
Default

Thank you so much for this. I've started to build the template and it's looking good so far. Mind if I ask another question? The pieces of information that I am creating for the Building Blocks are details on certain modules from a system I use. Which building blocks are selected are based upon the decisions that a user makes in an existing Excel document. My plan would be that they would fill in their excel document and then use this to manually decide which building blocks are needed via the userform. Do you know if there is a way to link the two together so that once an excel sheet is filled in this acts as the userform and will then populate the document using the building blocks? Hope I've explained that well enough. I know what I want, just not how to describe it!!! Thanks again, you have been a great help.
Reply With Quote
  #6  
Old 07-12-2016, 04:32 AM
Charles Kenyon Charles Kenyon is online now Can Excel be used to generate a seperate Word document? Windows 8 Can Excel be used to generate a seperate Word document? Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,082
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

I believe that this can be done. It is beyond my competence, though. I do very little programming in Excel. I would suggest posting here: Word VBA Forum

I suspect I would create the UserForm in Excel and have it manipulate the Word objects.
Reply With Quote
  #7  
Old 07-12-2016, 05:47 AM
Shearvirgo Shearvirgo is offline Can Excel be used to generate a seperate Word document? Windows 10 Can Excel be used to generate a seperate Word document? Office 2013
Novice
Can Excel be used to generate a seperate Word document?
 
Join Date: Jul 2016
Posts: 5
Shearvirgo is on a distinguished road
Default

Thank you Charles, you have been an unbelievable help! Take care.
Reply With Quote
  #8  
Old 07-12-2016, 05:50 AM
Shearvirgo Shearvirgo is offline Can Excel be used to generate a seperate Word document? Windows 10 Can Excel be used to generate a seperate Word document? Office 2013
Novice
Can Excel be used to generate a seperate Word document?
 
Join Date: Jul 2016
Posts: 5
Shearvirgo is on a distinguished road
Default Can Excel be used to generate a seperate Word document?

Hi, I have an excel spreadsheet that will be used to select what modules a user would like training on. I have created information for each module in word as a building block. Is it possible to automatically generate a Word document using the building blocks based on decisions made in Excel? Thanks in advance.

Last edited by Charles Kenyon; 07-12-2016 at 10:46 AM. Reason: Note, I merged the previous Word thread into here.
Reply With Quote
  #9  
Old 07-12-2016, 09:11 PM
gmayor's Avatar
gmayor gmayor is offline Can Excel be used to generate a seperate Word document? Windows 10 Can Excel be used to generate a seperate Word document? 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

You can do this either from Excel or from Word. Which is better rather depends on what you propose the users are going to do with the worksheet. If they are not making changes to the worksheet but merely making selections in a userform from data on the worksheet, then I would do it all in Word. If they are making changes to the worksheet and creating a document based on those changes, then I would do it in Excel. Either way you create a document from your template and write values to it from the worksheet (or based on the worksheet).

There are two functions available from my web site that will help. The xlFillList function at http://www.gmayor.com/Userform_ComboBox.html will read the worksheet into a userform list box or combo box from where a user can make suggestions. The box in question will be multi column so all the data required from each record is in the box, so you can process the selected record from the data in the columns of the box.

The other function is the FillBM function at http://www.gmayor.com/useful_vba_functions.htm which can be used to write a value from the userform to a bookmark in the document.

Working from Excel, you can read the values directly from the worksheet, but the fillBM function will need modifying to work with the specific document you are creating and not ActiveDocument.

The code to create a document from Excel would be

Code:
Dim wdApp As Object
Dim wdDoc As Object
    On Error Resume Next
    Set wdApp = GetObject(, "Word.Application")
    If Err Then
        Set wdApp = CreateObject("Word.Application")
    End If
    On Error GoTo 0
    Set wdDoc = wdApp.Documents.Add(Template:="C:\Path\TemplateName.dotx")
    'Do stuff with wdDoc
The bigger problem is how the users are going to have access to the worksheet, and the template in order to create the document.
__________________
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
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can Excel be used to generate a seperate Word document? Importing Data from seperate closed excel file KingoftheKassel Excel Programming 1 06-10-2016 08:34 AM
Can Excel be used to generate a seperate Word document? generate and save document versions with different print areas schroedercn Word 1 05-20-2014 06:01 AM
Generate Excel Speadsheet from Access, Web, or??? chrisalter Excel 0 07-12-2011 01:04 PM
Can Excel be used to generate a seperate Word document? generate unique number on same document when printed benjii19 Word 1 03-08-2011 12:38 AM
Cannot generate 2003 Excel reports in IIS7 sword.fish Excel 0 02-22-2010 01:43 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:26 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