#1
|
|||
|
|||
Extract tables as images
Hello, is there any VBA code for extracting all tables from MS word documents and saving it as jpeg? I have looked all over but found nothing . |
#2
|
|||
|
|||
1. there is no native process to save a Word document as JPG (or jpeg). Therefore there is no VBA action to do so.
2. you will have to extract each table individually and save it separately. 3. perhaps saving each table file as PDF you could find a way to convert that to jpeg. I do not know offhand how you can do that but there are likely conversion applications out there. But again there is nothing in VBA to do so. 4. you could use the Snipping tool and get an image that way; or use PrintScreen and then paste the image into a graphics application and trim it to suit. Again, there is nothing in VBA to do this. Have you tried googling this? You say: "I have looked all over but found nothing", but if you google "save word file as jpeg" there are many many links, but again, none of which use VBA...because VBA can not do this. |
#3
|
||||
|
||||
Although this can't be done directly from Word, it can be done in code from Excel (see: http://dmcritchie.mvps.org/excel/xl2gif.htm). Accordingly, if you automate an Excel session and copy your tables to Excel, you can save them as GIFs, etc, from there.
In Word, you can use the CopyAsPicture method combined with PasteSpecial or PasteAndFormat to create an image of the table in the document, but those methods tend to lose border details and the add a lot of white space around the copied table.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to create tables around all images in document | lsmcal1984 | Word VBA | 4 | 12-01-2013 06:58 PM |
editing of images, tables and caption in the whole document. | Jamal NUMAN | Word | 4 | 07-08-2011 04:14 AM |
How to control the distance above tables as we do for images? | Jamal NUMAN | Word | 2 | 07-08-2011 04:09 AM |
Mail Mege Images - Path Correct but Images Repeated | Sonia Sosa | Mail Merge | 8 | 04-22-2011 03:05 PM |
Extract Photographs | The Gap | PowerPoint | 4 | 04-22-2010 07:00 AM |