Hi everyone,

I'm a beginner level VBA learner. Started with some simple macros and figured out that I can automate a lot of things with VBA. So, I 'm getting more into it. I have a new project. In this project, my aim is to create an excel file in which users input some data and press a macro button which then creates a word template (with some predefined wording/format) and automatically inserts the user data to some specific fields in that word document and converts the final word document to a read-only one and saves the word doc to a predefined folder.

This will be used to create our agreements with customers. Our company's agreements are 30-40 pages each with a lot of wording and there are several different type of agreements we use in different occasions. When there is a need for agreement, we need to find out which type to use, then fill in several fields in that specific type of agreement. When making this manually, it's taking too much time to find those fields in a huge file. And user might accidentally delete some other fields in the agreement. In order to prevent it and make the process much easier, I'd like to make this excel file so that, users can fill in only a few cells on a clean excel sheet, press a button and create the agreement in word form, and they can't damage the wording of the agreement.

I can't use simple 'text form fields' and restrict editing in word. Because, in some cases, there are fields which needs to be duplicated if there are more than 1 company in the agreement (see below).

means [ ], a company organized under the laws of [ ], and [ ], a company organized under the laws of [ ] and their successors and assigns.

In such cases, ideally user still enters the information to excel (company 1, company 2 ....) and the macro should automatically duplicate some specific parts of the word doc and fill in the information to those relevant parts. (i think it can be done with an if case)

Is this too much to ask from excel/word? I know it won't be an easy macro but i think it's doable. Can someone please give me at least some keywords or maybe some similar module examples that I can find online? I googled it but couldn't find any similar ideas.

I've found below module which creates a simple word doc out of an excel sheet, but then how can I make this conditional? Should I write down the whole 40 pages agreement text to macro , or should I attach the basic agreement template to the excel file as a word doc?

I'm a bit confused about where to start. Any help is appreciated.

thanks so much


Please Login or Register  to view this content.