Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2014, 06:16 AM
didijaba didijaba is offline Extract tables as images Windows 8 Extract tables as images Office 2010 32bit
Novice
Extract tables as images
 
Join Date: May 2014
Posts: 5
didijaba is on a distinguished road
Default 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 .
Reply With Quote
  #2  
Old 05-06-2014, 05:35 PM
fumei fumei is offline Extract tables as images Windows 7 64bit Extract tables as images Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 05-06-2014, 06:14 PM
macropod's Avatar
macropod macropod is online now Extract tables as images Windows 7 32bit Extract tables as images Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract tables as images Macro to create tables around all images in document lsmcal1984 Word VBA 4 12-01-2013 06:58 PM
Extract tables as images editing of images, tables and caption in the whole document. Jamal NUMAN Word 4 07-08-2011 04:14 AM
Extract tables as images How to control the distance above tables as we do for images? Jamal NUMAN Word 2 07-08-2011 04:09 AM
Extract tables as images 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

Other Forums: Access Forums

All times are GMT -7. The time now is 06:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft