Hello
I am a VBA novice but have been having a crack at the following problem but I need more expert input and assistance.
The problem is to extract information from control content field into tables and "related" and copying the information to a single row in excecl.
I am having difficulty putting together code to do the following.
VBA (activated by a button in excel - this bit is not the problem) code to go to a specific folder (ie "Project plans play") containing several project outline word documents (each with a different name).
For each word document, I want to extract the data in the content control fields and copy it into a word document (Project Breakdown).
The word documents would have the same structure with 4 content fields outlining the project (the fields are Project Name, Project Code, Project Manager, Project Priority) then below is a table with multiple rows of task information. The column headers are Project and Task Code, Task, Project Staff, Start Date, End Date, Number of Days and Milestone.
The 4 content control outline fields would be copied and written in the first four columns of the excel spread sheet and the first row of the table containing task information (ie Project and Task Code, Task, Project staff etc etc until Milestone) would be also written to the adjoining cells in the row.
The code would then get the next 4 content control field outline fields of the same document and the next row of task information in the table and copy it to excel in the next row.
The next step would be repeat the copy and writing process until the data in last row in the task table in word is copied to excel.
The code would do this for each project document in the folder. I imagine there could be 20-30 to them.
Attached is an example of the word document containing the project information and also the excel spread sheet which would receive the information.
I have seen and explored some code that grabs the information in work in content control fields and copies it to excel but I cant seem to extend this code further to copy and write additional rows of data in the word document.
Any help or code would be appreciated.
I might have chosen a difficult problem to start my learning.
Thanks.
I am a VBA novice but have been having a crack at the following problem but I need more expert input and assistance.
The problem is to extract information from control content field into tables and "related" and copying the information to a single row in excecl.
I am having difficulty putting together code to do the following.
VBA (activated by a button in excel - this bit is not the problem) code to go to a specific folder (ie "Project plans play") containing several project outline word documents (each with a different name).
For each word document, I want to extract the data in the content control fields and copy it into a word document (Project Breakdown).
The word documents would have the same structure with 4 content fields outlining the project (the fields are Project Name, Project Code, Project Manager, Project Priority) then below is a table with multiple rows of task information. The column headers are Project and Task Code, Task, Project Staff, Start Date, End Date, Number of Days and Milestone.
The 4 content control outline fields would be copied and written in the first four columns of the excel spread sheet and the first row of the table containing task information (ie Project and Task Code, Task, Project staff etc etc until Milestone) would be also written to the adjoining cells in the row.
The code would then get the next 4 content control field outline fields of the same document and the next row of task information in the table and copy it to excel in the next row.
The next step would be repeat the copy and writing process until the data in last row in the task table in word is copied to excel.
The code would do this for each project document in the folder. I imagine there could be 20-30 to them.
Attached is an example of the word document containing the project information and also the excel spread sheet which would receive the information.
I have seen and explored some code that grabs the information in work in content control fields and copies it to excel but I cant seem to extend this code further to copy and write additional rows of data in the word document.
Any help or code would be appreciated.
I might have chosen a difficult problem to start my learning.
Thanks.