Consulting

Results 1 to 5 of 5

Thread: Multiple Userforms and Multiple Documents

  1. #1

    Multiple Userforms and Multiple Documents

    Hi All,

    So I have been creating some userform templates to create a document (which is a Request Memo).

    I have currently been doing this for each 'request type' and this has been working fine, however I have been toying with the idea of having 1 document that covers all 20 request Types.

    I have been able to add several userforms so that Userform1 lists all the options and depending on what is selected will open the other userform for that specific request type.

    Is there a way that i can add several documents in to the project so that there are 20 documents, but only one of them will be produced at the end (not more than one document will be created at a time)?

    Essentially i am wanting to be able have 20 Userforms (which from a users perspective will look like on interface) and one document produced.

    Is there a way to add documents to the project so that depending on what userform is completed it will fill out that docment only, or do i need to prepare 1 huge document (which covers all 20 request types) and then the userforms just delete stuff?

    I have attached a quick mock up of the userforms

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Are all the Request Memos in a standard layout?

    There are way too many possibilities to start programming without knowing a lot more about your Doc System.

    I am thinking that if the blank Request Memos are very similar, then one User Form with up to 20 "Helper" Modules may be the way to go.

    Another Option is 20 Request Memo Templates and either one UF for all or one in each Template.

    :
    :
    :
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,340
    Location
    I've done something similar with a single userform with optionbuttons (say 20, 1 for each request type) and a multipage control. When the user selects the option button the option button change event is triggered to display the proper multipage page tab with fields to fill in. When the command button is clicked the correct document is created from its dedicated template defined in the option button tags.
    Greg

    Visit my website: http://gregmaxey.com

  4. #4
    Hi Gent,

    Thanks for the reply.

    I currently have the 20 different templates (all with their own userforms).

    I have played around with Visual Basic and have been able to import all the userforms into one project. So userform1 is just a combobox with all the options. once an option is clicked on userform1 hides and the userform for that particular work type opens.

    Unfortunately all the templates are significantly different. i was wondering whether there was a way to 'import' all the forms into the same project and then depending on which userform is auctioned depends on which template is called on and produced?

    The alternative i have been playing around with is to merge all the templates into one document (about 60 pages ). the annoying thing is i have to slowly make my way through the 60 page's bookmarks (as some of the bookmarks have the same names across my templates) and change them. Another issue i have run into is one of my commands is pretty lengthy and i get this pop up saying that the code is to long. given this, i am unable to put in more code to delete the other 58 pages that i would not need.

    I am fairly new to VBA, so i apologizes if this is a stupid question.

    Thanks again

  5. #5
    I would keep the 20 templates that you already have. This is much simpler to work with and easier to change should the content of just one require adding. I would put the templates in a folder and use http://www.gmayor.com/select_document_template.htm to select the required template from that folder (or roll your own macro to perform a similar task).

    Another approach would be to have an add-in with a dropdown template selector on the ribbon which could have plain text commands to create documents from templates associated with those commands. You will find lots of information on modifying the ribbon on Greg's web site http://gregmaxey.mvps.org/word_tip_p...bbon_main.html
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

Posting Permissions

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