Sissyfoo
11-24-2005, 09:37 PM
I was wondering if anyone could give me some tips for a project I'm working on.
I am toying with the idea of importing word documents into a pre-built excel report. The trouble with these documents is that they do not have a standard layout and they change constantly from month to the month. The excel report that they would be imported into has a constant layout and cannot really be altered much.
If the reports were just text then I'd probably be fine but they also have tables which is causing a bit of trouble. I had toyed with the idea of opening the .docs, pulling all the data into a control textbox and then closing the .doc file. This works great for plain text (although I lose the formatting...no biggie) but it isn't really printer friendly if the textbox requires the use of scroll bars. It is terrible, however, for tables.
Is there a way that anyone can suggest to go through a .doc, pull out all the text and place it in a text box and then pull out any tables and insert them into excel?
Is it possible (making my life a tad more complicated, yay) to go through the .doc and export the text to a textbox but if it comes across a table in the range of paragraphs to export the table and place it into the spreadsheet and then create a new textbox and carry on exporting text?
For example, if the doc contained *text text text* *table* *text text text* then this would be exported to excel in the form *textbox* *table* *textbox*.
It isn't the end of the world if this can't be done. I was just curious to know whether or not it is possible and, if it is, I'll take a crack at it. If not, then the users will have to make do with hyperlinks to the .docs stored on some webserver somewhere. :)
Thanks,
James http://vbaexpress.com/forum/images/smilies/039.gif
I am toying with the idea of importing word documents into a pre-built excel report. The trouble with these documents is that they do not have a standard layout and they change constantly from month to the month. The excel report that they would be imported into has a constant layout and cannot really be altered much.
If the reports were just text then I'd probably be fine but they also have tables which is causing a bit of trouble. I had toyed with the idea of opening the .docs, pulling all the data into a control textbox and then closing the .doc file. This works great for plain text (although I lose the formatting...no biggie) but it isn't really printer friendly if the textbox requires the use of scroll bars. It is terrible, however, for tables.
Is there a way that anyone can suggest to go through a .doc, pull out all the text and place it in a text box and then pull out any tables and insert them into excel?
Is it possible (making my life a tad more complicated, yay) to go through the .doc and export the text to a textbox but if it comes across a table in the range of paragraphs to export the table and place it into the spreadsheet and then create a new textbox and carry on exporting text?
For example, if the doc contained *text text text* *table* *text text text* then this would be exported to excel in the form *textbox* *table* *textbox*.
It isn't the end of the world if this can't be done. I was just curious to know whether or not it is possible and, if it is, I'll take a crack at it. If not, then the users will have to make do with hyperlinks to the .docs stored on some webserver somewhere. :)
Thanks,
James http://vbaexpress.com/forum/images/smilies/039.gif