PDA

View Full Version : VBA in Word: Help



rkc2009
01-13-2009, 07:54 AM
I have a simple task to complete regarding VBA in word. I will be using a word template similar to this:
______________________________________
Title of Document

Month and Year

Heading 1 SAMPLE LAYOUT

Heading 2

Heading 3..etc
_______________________________________

My task is to fill this template with information that falls under specific headings. Different individuals will be sent this word template and asked to provide information for whichever heading they are assigned. When all these individuals have completed their portions, they will submit the document to a manager and the manager will gather it all in one folder. The job of the macro is to search each submitted document (which will be in the same format as the template) and to place the information under the correct heading of the master template. Basically, the macro will look through all the documents and organize them into the master template so that it will have all the needed information. Are there any suggestions on how to do this? Any suggestions would be greatly appreciated.

lucas
01-13-2009, 08:44 AM
Doesn't sound very simple to me. What have you tried?

rkc2009
01-13-2009, 08:48 AM
Well the way I did it was that the files in the folder would be titled based on whatever heading they would fall under. And so the macro would copy the contents of each file, then go to the master file, find the right heading, and paste the text under that heading. It wouldn't check each file, however. It would ask the user to input the name of the file and then run the macro. My boss wants the macro to automatically go to the specified folder, check each file, and take out the contents and paste it under the correct heading. So yeah, you're right I guess, he made it sound simple but doing vba for it is complicated. Help please :)

lucas
01-13-2009, 09:05 AM
Can we see what you have. When posting code, select it and hit the vba button and it will be formatted for the forum.

fumei
01-14-2009, 10:16 AM
Yes please. Post whatever code you have tried so far.

Also, you need to clarify explicitly what it is you are trying to do.

"And so the macro would copy the contents of each file, then go to the master file, find the right heading, and paste the text under that heading."

Copy the contents....where exactly? It sounds like it is copied somewhere, and then pasted again.