+ Reply to Thread
Results 1 to 13 of 13

Export UserForm CheckBox data to Word-template

  1. #1
    Registered User
    Join Date
    09-22-2015
    Location
    Finland
    MS-Off Ver
    Office 2016
    Posts
    26

    Question Export UserForm CheckBox data to Word-template

    Hello Gurus!

    Is there any solution to populate CheckBoxes with Word files, and then export the data from Word files to a Word Template?

    Here's an example how it should work:

    CheckBoxtoMasterTemplateExample.jpg

    You can find the example files from the attachment.

    This userform already opens the MasterTemplate.dotx by clicking the "Export selected textfiles to MasterTemplate" -button.
    CheckBoxes are not linked to Word files nor it will export any data from them to the MasterTemplate. Any solution?

    Thx in advance!

    -ODeveloper

    CheckBox to MasterTemplate.zip
    Last edited by ODeveloper; 10-15-2015 at 09:37 AM.

  2. #2
    Registered User
    Join Date
    09-22-2015
    Location
    Finland
    MS-Off Ver
    Office 2016
    Posts
    26

    Re: Export UserForm CheckBox data to Word-template

    Can someone help me with this? Or is it really too complicated to do it this way? Any other solutions?

    -OD

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Export UserForm CheckBox data to Word-template

    The first thing I would do is change from multiple checkboxes to a multiselect listbox.

    That will make things far easier when it comes to seeing which documents the user has selected to add to the template.

    The attached file should show you what I mean.
    Attached Files Attached Files
    If posting code please use code tags, see here.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Export UserForm CheckBox data to Word-template

    Here's the code to add the text from the selected files to the template.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-22-2015
    Location
    Finland
    MS-Off Ver
    Office 2016
    Posts
    26

    Re: Export UserForm CheckBox data to Word-template

    Hey Norie,

    Thx for the answers! In my case it's better that the checkboxes are separately. I have over 100 checkboxes and they are already grouped in different frames.

    I tried your upload, but it didn't import the text files. MasterTemplate opened without selected textfiles data. Am I missing something here? Is there any possibility that you could implement that code to the original file I sent.

    Thanks anyway!

    -ODeveloper

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Export UserForm CheckBox data to Word-template

    There was no code in the uploaded file to add the data from the textfiles to the template, I justed post the code to do that in post #4.

    As for multiple checkboxes, that sounds like a nightmare to me unless you have good naming convention going on.

  7. #7
    Registered User
    Join Date
    09-22-2015
    Location
    Finland
    MS-Off Ver
    Office 2016
    Posts
    26

    Re: Export UserForm CheckBox data to Word-template

    Hi again,

    I opened the file you uploaded and found this from the Module1:

    CaptureNorie.JPG

    How can the code be there if you didnt put it there? :D

    For me it would be much harder to put all the checkboxes to a listbox. There would then have to be several different listbox, and you couldnt see what you have chosen, unless you open them all separately. Now they're all in one big window which makes it much clearer to see what's chosen.

    Maybe I'm missing something here(?) But the code still isn't working. First, there should be a code to link the checkboxes to the word files, right?

    -OD

  8. #8
    Registered User
    Join Date
    09-22-2015
    Location
    Finland
    MS-Off Ver
    Office 2016
    Posts
    26

    Re: Export UserForm CheckBox data to Word-template

    Oh damn, sorry I'm not awake I guess... :D Got it!

    Thx Norie!

  9. #9
    Registered User
    Join Date
    09-22-2015
    Location
    Finland
    MS-Off Ver
    Office 2016
    Posts
    26

    Re: Export UserForm CheckBox data to Word-template

    I would be very thankful if you could make the same code for the checkboxes instead of listbox.. I'm too newbie to figure out how it's done.

    Thx,
    ODeveloepr

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Export UserForm CheckBox data to Word-template

    How couldn't you see what was selected in the listbox(s)?

    You don't 'open' listboxes, perhaps you are thinking if comboboxes?

    As for linking checkboxes and Word files that's one of the things I can see being difficult when using checkboxes.

    I'll see if I can come up with something using checkboxes instead of a listbox and post it later.

  11. #11
    Registered User
    Join Date
    09-22-2015
    Location
    Finland
    MS-Off Ver
    Office 2016
    Posts
    26

    Re: Export UserForm CheckBox data to Word-template

    I have some comboboxes which define the value for checkboxes (true/false). But in every case, the user have to be able to uncheck and check some of the checkboxes by hand.

    Here's a small example where the value chosen to comboboxes have defined a pre-selection to checkboxes (sorry for the hard censoring):

    Capture.JPG

    The preselection would be more complicated to do to listbox I guess?

    Or would there be an easier way to do all this?

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Export UserForm CheckBox data to Word-template

    Well since you seem to have some sort of hierarchical thing going on listboxes might not be appropriate, but I suppose you could look at using a treeview.

    Do you have the 'hierarchy' stored somewhere?

  13. #13
    Registered User
    Join Date
    09-22-2015
    Location
    Finland
    MS-Off Ver
    Office 2016
    Posts
    26

    Re: Export UserForm CheckBox data to Word-template

    Treeview sounds interesting.

    The 'hierarchy' exists already, but so far I only have a part of it in my head. I'm working on "visualising" it at the moment..

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Send Data From Excel Userform to Microsoft Word Document Template
    By t0mps in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-09-2014, 03:18 PM
  2. Excel userform to Word template letter with bookmarks
    By scottiec21 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-09-2014, 09:22 AM
  3. [SOLVED] Send UserForm CheckBox Value to MS Word
    By MooseAUH in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2014, 02:52 PM
  4. Export from Excel to a Word Template
    By mrmoc85 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-22-2013, 10:58 PM
  5. Export data to a word template
    By Wakey1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2007, 06:03 AM
  6. Export UserForm Image for use in Microsoft Word
    By Andy B via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2006, 12:45 PM
  7. [SOLVED] export excel data to a word template using a macro
    By Ross1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-25-2005, 01:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1