![]() |
|
|
|
#1
|
||||
|
||||
|
Cross-posted at: http://answers.microsoft.com/en-us/o...6-bc3837ccb721
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
Meaning of figure of height and width that i don't want to change h & w in code for each cells as i mention that all the cells have different size. i actually need one macro that resize any picture with size of selected cell.
|
|
#3
|
||||
|
||||
|
Quote:
Your code could be made more efficient, though: Code:
Sub FitPics()
Application.ScreenUpdating = False
Dim Tbl As Table, iShp As InlineShape
With ActiveDocument
For Each Tbl In .Tables
For Each iShp In Tbl.Range.InlineShapes
With iShp
.LockAspectRatio = msoTrue
.Height = .Range.Cells(1).Height
If .Width > .Range.Cells(1).Width Then
.Width = .Range.Cells(1).Width
End If
End With
Next
Next
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#4
|
|||
|
|||
|
Its work good but no as i want, if original picture height > width then after running code its resize on width and crop height with picture size. or if width > height then code resize width only with cell size.
|
|
#5
|
||||
|
||||
|
Quote:
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
| Tags |
| ms word 2010, picture format, word vba macro |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Word template that automatically resize's and formats image layout | vikkitoria60 | Word VBA | 3 | 09-30-2015 01:16 PM |
| Insert and resize image | lenguyenleduong | Word VBA | 2 | 05-11-2014 07:23 AM |
| Shortcut for image resize | Hatthans | PowerPoint | 0 | 01-06-2014 04:32 PM |
| How to resize the image in the header so that it fits the page | Isadora | Excel | 1 | 08-20-2013 06:02 AM |
| Image proportional resize not functioning! | alexfcm | PowerPoint | 0 | 09-27-2012 07:22 AM |