#1
|
|||
|
|||
Need to create document that will auto insert text based on parameters
This is difficult. I do regular lawyer stuff and I just want to automate things.
My document is usually 50 pages long. It consisits of pages of content. But the content depends on that person date of birth. If he is born in January, then I have to manually insert few paragraphs for month januarry....if he is born on febriary, then I have to insert few other paragraphs of text.... It is time consuming to copy and paste all the time based on the DOB parameter.... Could I just make it automatic, so at the start of document I would have a form that would ask me for name, last name of the client and DOB.....so if I select january word would automatically populate document with january custom content.... There are 12 variations of text, for each month of the person I hope this can be solved somehow Last edited by Charles Kenyon; 07-25-2017 at 12:29 PM. Reason: Modify title to clarify problem |
#2
|
|||
|
|||
Hi,
Not sure if those kind of things can be done in regular word but in VBA I would think this should be achievable. So laws change depanding on what month someone is born can you give us an example of what text or paragaphs have to be entered? Depanding on the length of those textes or paragraphs but maybe you could you use bookmarks? SW |
#3
|
|||
|
|||
January person : use text A
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA February person text B BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB March person text C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCC I hope you understand |
#4
|
|||
|
|||
the idea is that for example 12 paragraphs are stored in WORD backend somewhere, if that is possible and then just inserted based on choosing the month of the person
but month of the person is just example I have like 7 different parameters name, last name, DOB............etc.... |
#5
|
|||
|
|||
It can be solved so long as your date is simple. That is, if you have three fields, one for month, one for day, and one for year, it should not be difficult. If you have a date field, though, it gets tougher.
The basic field is an IF field. You have to identify your month field in some way. I would suggest using either Mapped Content Controls or legacy form fields for your drop-down. Content Controls and legacy fields should not be used in the same document, you should choose one or the other. The advantage of the legacy controls is that you can check the "calculate on exit" box in properties and any IF fields based on that control will update automatically when the user tabs out of the control. A second advantage is that it is easy to give a legacy control a bookmark name. A disadvantage is that the document must be protected for "filling in forms" which disables ability to use many other Word features. Another disadvantage is that these are "legacy" controls and at some point Word may stop using them. The advantage of content controls is that it can be "mapped" so that you do not need bookmarks to reference it. Another advantage is that such controls are likely to be supported in Word longer than the legacy controls. The document does not have to be severely restricted as far as editing goes. |
#6
|
|||
|
|||
The parts to be inserted can be inserted using an AutoText field and stored as AutoText entries in either your document template or a global template.
Automated Boilerplate Using Microsoft Word |
#7
|
|||
|
|||
Quote:
So it will be IF the mnoth is 1(january) then paste this content here at this bookmark Yes I just want to use form to input data...... lets say 7fields and I will just input it and word will calculate everything and create document..... But I want to definately hide the form field from end user....is that possible he must not know content was generate like that What do you mean by locking the word doc? I need to edit it, but the end user not, because I will save it as PDF anyways, so he will be able to read it only |
#8
|
|||
|
|||
Quote:
maybe can word just create another document from this template....so it will be not the same doc and not have any forms etc...that would be the best.... is that link you gave me easy to understand? I want to paste also like content that is 3 pages long.....is that ok or too much data? imagine guys I am creating personal report for somebody and I want to just let the word do all the pasting of the pre prepared text....based on parameters like age, day of birth, month, name etc...... |
#9
|
|||
|
|||
Quote:
You could include a lot of stuff in a single AutoText entry. Editing an AutoText entry, though, requires inserting it in a document, making changes, and then resaving it with the same name. My laptop is acting up on this site and may need a reboot. Here is a template that shows a bit how this works. Using repeating data in IF Fields Sample template with AutoText.dotx That looks at some different methods. You have at least three parts to your problem:
Here is the bible on field calculations: https://www.msofficeforums.com/word/...-tutorial.html Using a template, you create a new document in each instance of use. That document does not contain the AutoText but has access to it. When you convert that document to pdf, the link is lost and the AutoText is put in as text/images. The thing about fields that test data is they are not automatically refreshed. The only exception is in a document protected for filling in forms. I don't think you want that. So, no legacy fields and you will have to refresh the rest. That can usually be done with Ctrl+A (Select All) followed by F9 (update field). You can get fancier than that, but we are already very complicated for a beginner. |
#10
|
|||
|
|||
Take a look at Repeating Data Using Document Property Content Controls and Other Mapped Content Controls.
That is about putting something in one place and having changes to it show up everywhere it is used. If the Document Property Content Controls are used it is very easy. If you need more, there is a link to information on Mapped Content Controls. The sample I posted has examples of both a Document Property Content Control (the date picker sample) and a mapped content control. |
#11
|
|||
|
|||
If you are doing this for your own use, you owe it to yourself to devote some time learning more about Word first. Otherwise you'll end up with a bunch of stuff that will drive you crazy. Start with Styles and Templates. If you do not have a handle on those, you will be exponentially increasing your headaches.
I guarantee that every hour you spend learning this stuff (at least up to the first 40) will be repaid fivefold within the next couple of months. |
#12
|
|||
|
|||
The date picker content control in the sample took some work but it turns out that you can simply select the date of birth and have it show the month or day or year when testing for putting in other text.
To look at fields in the template you will need to press Alt+F9. That toggles display of field codes. Don't forget to toggle back, though! |
#13
|
|||
|
|||
I am a criminal defense lawyer. I have a lot of forms and boilerplate pleadings I need to use as rough drafts. So I have basic information about a case that needs to go into a number of different documents at different times. For that, I use Mail Merge. It gives me the rough draft of my document with the client and case information filled in. I make some changes and file with the court or send to opposing counsel. That is a different method than what you are looking at.
|
#14
|
|||
|
|||
Please post back after you've looked at the template and given some thought about your project. Remember, it does not have to be perfect, just good. You can refine later.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copy text to new document based on paragraph numbering | mike.mm | Word VBA | 7 | 11-22-2016 06:14 AM |
How to insert hyperlink based on text | PRA007 | Word VBA | 2 | 11-05-2015 05:30 AM |
How to insert hyperlink based on the text | PRA007 | Word VBA | 3 | 05-11-2015 01:11 AM |
Auto populate & auto calculate values from other sections in the same word document | Frantic | Word VBA | 2 | 01-24-2015 04:54 PM |
Insert image based on document custom property | anandyrh | Word | 1 | 08-14-2013 12:08 AM |