|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Hi, I wonder if I can make a dynamic document to speed up the creation of document
I have standarized report document besed on user data, DOB, name, last name etc.
Based of the users day of birth I create the report for him which is 80 pages long. I have basically 9 different documents for each day of birth 1-9 So each birth day has different text but it takes me like 30 minutes to put everything together instead of few minutes dong it programatically by inserting required text based on user DOB name and Last name. So how to make this dynamic document. There is no real tutorial on the web that I could find. I would like to speed up my work Thank you |
#2
|
|||
|
|||
Quote:
I'm not sure what you mean by each day of birth 1 through 9. One through 7 I would understand, meaning days of the week. One through 31, day within a month. If you're only inserting a few variables into an otherwise standard report, then I suggest you consider using a mail merge. You would put your variables (the stuff that will be customized with each document) into a table in an Excel spreadsheet. Then you'd use Word's mail merge setup to insert fields into your existing document where those details will be inserted. There are some good Word mail merge tutorials on YouTube; most will be showing you how to merge for the purpose of multiple short items like form letters or invoices, but you can use the same technique for one. Other methods could include using document fields within Word to help you insert the same information over and over (for example, if you wanted to repeat the subject's first name over and over again) but get a little clunky to insert a handful of different variables, then change them for the next use. I mentioned some of this in this other answer on this forum, including some links to some videos and reference docs : https://www.msofficeforums.com/165252-post2.html If you are really talking about inserting or not inserting whole sections into your document based on date of birth criteria, then you might want to look into keeping each section in a separate Word file and merge them. You could then write macros/VBA that would insert segments 1, 4, 7, 11. This shows a simple way of doing the combining: https://www.youtube.com/watch?v=zLNlRlvaU2w I'm not sure whether you are talking about having one of nine different basic document types, or whether each document gets highly customized and personalized. Best, Ann |
#3
|
|||
|
|||
Ok let me explain
It is an astrology report. And I have 9 different variations DOB 1 are born on 1st, 10th 19th 28th of the month so if I put in DOB 1 I have 20 pages of content that is always the same for DOB 1 For DOB 2 there is different text because they are born under new date and new text is for them SO I am alwayx just copy and paste llarge chunks of text from saved templates into new document based on DOB... I want to have several variables at the beggining of the doc then after I fill it for example DOB it will automatically prepare the whole document.... |
#4
|
|||
|
|||
Look into using AutoText.
Automated Boilerplate Using Microsoft Word It can be triggered using AutoComplete, using an AutoTextList field, or otherwise inserted using the F3 key or even a macro. It can be included in a Building Blocks Gallery Content Control. |
#5
|
|||
|
|||
te second part of document has also 9 variations based on Date of birth
and then same text for several pages for all 9 variations But here is the trick...I want to color different chunks of text based on their sun sign for example if he is aries the aries text would be colored in red if he is aquarius aquarius text would be colored in red etc so I would like to have a form where I select his sign so it automatically gets colored can this be done? I want to automate as much as possible...so coloring the text and rechecking manually takes a lot of time |
#6
|
||||
|
||||
Based on the information provided, this is relatively simple to achieve using a macro to call a userform in which you can select the birth sign based on the birth date and write various values to the report as in the rudimentary example attached. See also Create a userform
Personally I would probably use content controls rather than docvariables to display the text again as in the attached, but either is possible.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#7
|
|||
|
|||
Quote:
I think the first thing for you to do is make a kind of flow chart. Do you want to create nine different templates corresponding to your birth date factor, or twelve templates corresponding to each zodiac sign? Or one master template from which you then have to remove or modify all the parts that are not applicable? Break your document apart into segments. Maybe each document has a section 1 through 10, but if your subject is in Category 1 by birth date number, he gets Section 4 type A. If he's a Pisces, the tenth paragraph in Section 7 is red, but if he's Cancer, it's the 11th paragraph. You could either write a script that would actively change the color of the text in one document, or it would grab the prepared highlighted Pisces version of that text and insert it. The latter is where the AutoText/Building Blocks feature that Mr. Kenyon has mentioned comes in. I guess you can save large chunks of text as building blocks; I tend to use it for mostly single paragraphs, or text boxes, or graphics. If you haven't used building blocks, there are some decent YouTube videos found by searching "Word Building Blocks", and this one is using Word 2016 specifically. https://www.youtube.com/watch?v=2__Oh8stI-o Whichever method you determine best to put it all together, all of this will be helped by having a thorough knowledge of Styles in Word. If you already use Styles, so much the better. When my job changed and I started using Word much more for editing long, annotated documents, I ended up taking some of the Word courses on LinkedIn Learning (formerly Lynda.com), which are free with the first month's trial. It was a good refresher, and I learned a lot. The classes with Gini Von Courter were particularly good. Best, Ann |
#8
|
|||
|
|||
>Hmmm i get it....
I think putting all the text in the document to have 1 huge file and then based on dob and zodiac it would delete the obsolete... how hard is it to learn macros? Autotext does not delete text? Just adds it? |
#9
|
|||
|
|||
Quote:
AutoText does not delete, no, but you can use a Building Blocks Content Control or an AutoTextList Field to simply select what you want. The AutoText/Building Block is stored in template. That template can be your document template or it can be a global template. I believe that using AutoText/Building Blocks is likely easier than jumping into using a UserForm but it does require a basic understanding of templates and building blocks so that it stays available to you. |
#10
|
|||
|
|||
the last thing I want is to automate my excel forms...
I put in some dates based on DOB and present date to calculate one number in excel that is embedded in word...can this be automated too? |
#11
|
|||
|
|||
Quote:
Please ask one question per thread. While this is the same project for you, we want to make this forum helpful not just to you but to those who may be searching the web. Multiple questions per thread defeats this. Bringing in information from Excel is a different topic. How to post a question on this MSOffice forum |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
speed up macro to Highlight Phrases in document based on list input from text file | Gontch | Word VBA | 2 | 01-21-2021 11:08 AM |
How to record document creation? | Evil Overlord | Word VBA | 2 | 12-02-2018 04:55 PM |
Document creation with pre-defined text | scar1 | Word | 5 | 03-08-2017 12:08 PM |
Document Creation | Caerleon | Word | 1 | 09-11-2015 07:42 PM |
Document Creation | Privateer | Word | 3 | 06-20-2013 08:15 PM |