#1
|
|||
|
|||
Document creation with pre-defined text
Hi, I am here posting hoping to get a little help in building word documents. I have a need to create a document based on a set of pre-determined text I have saved depending on the situation. Ideally is there a reasonably simple way I can create a method to populate a word document based on criteria set in a pop-up or such like. I am currently helping my daughter on a school project where she has to send very similar documents out to companies asking for help. However in each case the letter is much the same however we are addressing different people and also depending on the company we are using slightly different text. I am looking for a way I can choose what type of letter we are sending fill in some criteria and the word document will be created on that. Can anyone offer any advise on best way to approach, as this will save us a lot of time. Thanks scar1 |
#2
|
||||
|
||||
What you're describing would often be done via a mailmerge using, for example, an Excel workbook or another Word document containing a table that has a separate row for each recipient and columns for the variable data (i.e. name, street address, suburb, state, variable text). When the merge is done, Word will create a document containing a separate letter for each recipient.
See: https://support.office.com/en-us/art...f-932c49474705 https://support.microsoft.com/en-us/...etters-in-word
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks for your response. I can see how mailmerge would be useful here however I am also looking to populate the content of the document with different wording depending on the company. I have pre-defined text that can be inserted, looking for a way to select this text, for example.
Dear <NAME>, I hope this letter finds you well. <Pre-determinted Text #1> I am therefore ask for your help in <Pre-determinted Text #2> <Pre-determinted Text #3> Yours hopefully Miss L Smith |
#4
|
||||
|
||||
As indicated in my previous reply, the variable texts could be in the mailmerge data file itself. Mergefields in the mailmerge main document could be used to output that text at the appropriate location(s).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
I agree with everything that Paul has told you already.
You could have your conditional text in your data file, or you could have a data point which says which conditional text is to be used. Then test that data point and insert your conditional text as appropriate. Take a look at Word Mailmerge Tips & Tricks and search for the word "conditional" for examples of use of the IF Field. |
#6
|
|||
|
|||
Great thanks both!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
FileSystemObject Compile Error: User-Defined Type Not Defined | gsrikanth | Excel Programming | 2 | 03-28-2022 06:32 AM |
Document Creation | Caerleon | Word | 1 | 09-11-2015 07:42 PM |
User-defined Type not Defined VBA Issue | OTPM | Project | 3 | 01-02-2014 01:47 PM |
Document Creation | Privateer | Word | 3 | 06-20-2013 08:15 PM |
Range.Information(wdStartOfRangeRowNumber): Application-defined or Object-defined err | tinfanide | Excel Programming | 2 | 06-09-2012 10:19 AM |