Creating multiple documents from form

K

kgsheltie

Is it possible to create multiple word documents from a form? For example, I work as a software consultant and we have to enter our time into several word documents that are then sent to the project manager and eventually the client. What I would like to do is have a form(preferably a web form) that I could enter information into that would then take that information and put it in to fields on several documents that are created from templates when I push a button.
 
G

Ganeth

Random thought that occurred to me: If you want to do this with a web form - I'm assuming that you want to make this service available to all the consultants who have to submit timesheets - then it strikes me that PHP might provide a workable solution rather than going with VBA. I know that PHP has facilties for working with Word documents (see www.phpbuilder.com/columns/yunus20031124.php3) and I assume that other server side languages have similar features

Doing this with VBA shouldn't be too difficult - I've only been using macros, etc, for a short while now and I've managed to create a macro that takes userform input and generates one or several documents based on that. All I did was

- Create a template Word doc containing placeholders (insert1, insert 2 etc) instead of the actual values
- Create a userform to get data from the user. You can include validation in the userform to screen for incorrect input
- Create a macro using Word's Macro recorder that opens the template and substitutes text for the placeholders. Replace the text inserted with variable names, and add the variable names as String arguments to the macro. You may also have to edit the code that opened the document and paste in an absolute path rather than just the document name
- Call the macro from the userform and pass it the data

If you haven't worked with VB before (I never had until this year) then there's plenty of tutorials on the Word MVPs site covering everything I had to do

Ganeth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top