#1
|
|||
|
|||
Generate template-based letter with multiple variables
I am fairly new to VBA but generally pick up things fast, with the help of handy google searching. For what I need I'm not getting any spot on hits, and my somewhat limited VBA experience is 100 % from excel.
I'm looking for a way to make a template of a standard issue letter which typically have 7-10 different variables. The people who are going to use this are not that adept at computers in general and need things to be super easy to handle. So I reckon the closest I could get is a form that opens when you open the template, with a window of input for all your different variables. Click. Letter done. Everybody's happy. I realise I might be getting in over my head, but what I'm wondering is... where do I start? Am I even in the right place? |
#2
|
|||
|
|||
Where do the values for the variables come from. Are they sets of well defined text. Are there any dependencies?
|
#3
|
||||
|
||||
Are the users in-house? Macros are a great solution when the template can be distributed easily to them - not so great when the template is emailed or downloaded because the macro security can be a complicating factor.
I would explore a non-macro solution first by using linked Content Controls and put a 1 page form in front of the letter as the 'input form'. The input form can be completed, and then the user can delete that page. To help setup the linked CCs in the file, you should use an addin template like Greg Maxey's Content Control Tools https://gregmaxey.com/word_tip_pages...rol_tools.html
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#4
|
|||
|
|||
Thanks for your replies.
Okay, so it's an audit report for small companies with nearly all generic text. Some variables necessarily needs to be put in directly (company name, financial results - company specific variables that cannot be imported from anywhere). Others will have 2-5 predefined options (organ addressed, choosing type of organization leading to words being replaced throughout the report, minor deviations in text or rearrangement of 3-4 words based on content of annual report) Should I still go non-macro? And how hard and/or time-consuming would it be to put together what I'm looking for? |
#5
|
||||
|
||||
I think you are missing Andrew's point about who is completing the document. If you are sending out the from for others to complete it is better to try and avoid macros. Content controls are better for that as you cannot force users to run macros. To that end https://www.gmayor.com/insert_content_control_addin.htm makes the insertion of content controls, and mapped content controls a simple task.
If you are filling in the form yourself (or someone in your company is tasked with that) then macros can more readily be used and to that end you might consider a userform to collect the data which can be written to bookmarks, variables or again and perhaps best of all content controls. Greg's site, referred to by Andrew, has a lot of information on Content Controls and how to manipulate them. Greg has been a good friend for more years than I care to think about, and he will not mind me saying that his add-ins tend to be for the power user, who understands what it is they do. He cannot resist the intellectual challenge of stretching what they are capable of. Mine are aimed more at the lay end user where such understanding is less necessary nor desirable.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#6
|
|||
|
|||
Thank you for the explanation, Graham. Content Controls it is then.
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
template text selection based on input multiple choice question | waba | Word VBA | 1 | 04-08-2018 02:31 PM |
Need a formula to set a field based on two variables | unknownhere2000 | Excel | 2 | 01-12-2016 01:05 PM |
Need help with a template based letter | xJennyx | Word VBA | 2 | 07-25-2014 09:00 AM |
Generate individual checklists from one template | pog451 | Excel | 0 | 02-04-2014 05:26 AM |
Calculating a cell value based on many variables | malawimick | Excel | 0 | 12-14-2011 05:29 PM |