PDA

View Full Version : Help needed: Copy a Line from One Word Document to Other!



shrivallabha
08-18-2011, 11:01 AM
This is my first post in Word VBA forum. I have some experience with Excel VBA (to clarify about my VBA background) and I do not know much about Word VBA (almost zero knowledge). Here's the complete scenario.

1. There are many departments and they prepare their own weekly report. Each report contains bulleted points under Headings like "Pending Items", "Planned Items" etc. Number of bulleted points vary.

2. So using these individual reports, Main report is created which is more or less compilation of all reports. This is being done manually as of now.

So is it possible to create the main report using word VBA like:
1. All departmental reports will be collected in a folder [manually].
2. When the macro in Main Report is run then it will loop through selected folder & all word docs.
3. Each department Doc will be opened and the bulleted points under each tab will be copied and pasted under Dept. Heading in Main Report.

This will save a lot of manhours and headache. I am attaching a sample (of Main Report and one Dept. Report)

Kindly advice me, if it is a feasible idea? At this point, I am trying to search Word VBA book. I have always benefitted from good advice on this forum. Hope to get the same. Thank you.

shrivallabha
08-19-2011, 11:28 PM
How difficult is it? And is it worth pursuing (if VBA part is extremely difficult and could become error-ridden etc.). Please advice.

shrivallabha
08-20-2011, 09:17 AM
I am getting a little impatient. So I have posted this on msdn forum:
http://social.msdn.microsoft.com/Forums/en-US/worddev/thread/cf0e06ed-2386-4e05-9df6-76c6b111b68a

Talis
08-21-2011, 12:36 PM
Could this work?
As each departmental report is a single table in a Word document create a macro to load each doc and process the table to allow for the maximum number of bulleted points (maybe set a maximum at departmental level). By this I mean standardize the number of rows in the table.
Each modified table is then copy/pasted into its own Excel worksheet.
In Excel (with which you're experienced) amalgamate the sheets into a master-sheet.
Copy paste the master-sheet back into Word. Format as required.

shrivallabha
08-22-2011, 10:16 AM
Thank you Talis.

On msdn thread I got a methodology which I have forwarded to IT guys. They will look after as I don't have the necessary skills as of now.

On the other hand, I wish it could be excel but company procedures and formats (and their app: word / excel) are beyond my capability as they are "approved formats" which are very difficult to change.

Thank you, maybe if something doesn't work then this could be the way to go!