#1
|
|||
|
|||
Pictures!
Hi,
I have searched and have found some examples but I just cannot get them to work. I'm using Word 2016. I have an Image field in a spreadsheet that is a path to the image, e.g. C:\Temp\image1.jpg, C:\Temp\image2.jpg. I've then inserted the Image field using Insert Merge Field to make sure it works, and it does - returns the text value. I then tried all the funky INCLUDEPICTURE stuff I've seen but always end up with nothing, in both preview mode and full merge mode. What am I doing wrong? Thanks |
#2
|
|||
|
|||
Dunno what was happening but deleting it all out and starting again seems to have fixed it (I can't spot any difference between what I posted above though!)
But, that's brought on another thing to solve. Can I format the pictures (dimensions)? If I do F9 to update, then change the size (to expand to fill the cell), when I preview or run it properly, they revert to their native size. These are images from all over the place so manually editing them is not an option. Thanks! |
#3
|
||||
|
||||
To constrain your pictures to fit within a given size, create & copy a single-cell table with a fixed height and width to wherever you want the images to go, then insert the field code into that. Any picture inserted into it will have its dimensions constrained to fit the space available, at the correct aspect ratio for the picture. To set the fixed:
• row height, use Table Tools>Layout>Properties>Row>Specify Height>Exactly. • column width, first uncheck the 'automatically resize to fit contents' option under Table Tools>Layout>Properties>Table>Options. Then set the preferred column width under Table Tools>Layout>Properties>Columns. You might also want to set the cell margins to 0 all round. It's also a good idea to format the cell paragraph with 0 before/after spacing.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
Thanks macropod. I've seen you post that elsewhere and I had already done that with my cell, but my requirement is to expand the picture to fit.
So cell is 5cm x 5cm, picture is 4cm x 4cm so it sits centrally in the cell (because of the alignment I set). It doesn't expand automatically, probably because it's not supposed to. |
#5
|
||||
|
||||
The only way to enlarge an undersize picture is to do so manually or via a macro; there is no mailmerge setting to do this for you. Such a macro might be coded along the lines of:
Code:
Sub Demo() Application.ScreenUpdating = False Dim iShp As InlineShape For Each iShp In ActiveDocument.InlineShapes With iShp .LockAspectRatio = True If .Range.Information(wdWithInTable) = True Then If .Range.Cells(1).PreferredWidthType = wdPreferredWidthPoints Then .Width = .Range.Cells(1).Width If .Range.Cells(1).HeightRule = wdRowHeightExactly Then If .Height > .Range.Cells(1).Height Then .Height = .Range.Cells(1).Height End If End If End If End If End With Next Application.ScreenUpdating = True End Sub For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
Thanks for your help!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I change multiple pictures in Word 2016 to all new pictures that appear in a specified order? | chaz | Word VBA | 7 | 07-11-2018 03:57 AM |
Comment pictures ? | lukael | Word | 4 | 07-11-2015 04:04 AM |
Pictures in Word | OfficeBuddy102 | Drawing and Graphics | 1 | 05-12-2011 12:49 PM |
adding Pictures | Maureenbool | PowerPoint | 1 | 08-24-2010 02:46 PM |
jumping pictures | jvandyke | Drawing and Graphics | 6 | 04-28-2010 09:55 AM |