![]() |
#1
|
|||
|
|||
![]()
Hi All,
I am attempting to convert all tables in a document to images, the code seems to work fine when the tables\pages are in portrait orientation. The issue of bottom rows being missing presents itself when landscape orientation has been applied. There is a prepping process that unmerges cells and splits tables per individual page, where appropriate. I have attempted many fix options, all to no avail. Code used below. please note, when I comment out "tbl.PreferredWidth = 0" all rows display, however only half of the columns then display. This was an issue i had found previously. Pulling hair out!! ![]() Code:
Sub ConvertTablesToImages(ByVal currentDoc As Word.Document) Dim tbl As Table, rng As Range, i As Integer Dim tWidth As Long, tHeight As Long For i = currentDoc.Tables.Count To 1 Step -1 Set tbl = currentDoc.Tables(i) tbl.Select Set rng = tbl.Range 'Get table width prior to resetting 'tWidth = ReturnTableWidth(tbl) 'tHeight = ReturnTableHeight(tbl) tbl.PreferredWidth = 0 tbl.Range.CopyAsPicture rng.Collapse Direction:=wdCollapseStart 'rng.Collapse Direction:=wdCollapseEnd tbl.Delete rng.PasteSpecial DataType:=wdPasteEnhancedMetafile 'rng.ShapeRange(1).LockAspectRatio = msoFalse rng.ShapeRange(1).ConvertToInlineShape Next End Sub Any help appreciated. Regards Gordon |
![]() |
Tags |
table conversion |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
converting PPT 2016 to PDF - images does not come correctly | Varun | PowerPoint | 0 | 10-17-2017 06:26 AM |
Word issue Landscape/Portrait orientation | Bearjew | Word | 5 | 06-09-2017 05:02 AM |
Powerpoint is converting movies to images | joezl | PowerPoint | 2 | 12-15-2014 04:01 AM |
![]() |
docrob | PowerPoint | 1 | 09-26-2011 01:38 AM |
![]() |
RodA | Word | 2 | 03-07-2011 04:51 PM |