Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Mail Merge

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 11-09-2018, 11:10 AM
ldoodle ldoodle is offline Windows 10 Office 2010 32bit
Novice
 
Join Date: Oct 2018
Posts: 17
ldoodle is on a distinguished road
Default 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
Attached Images
File Type: png mm-pic.PNG (11.3 KB, 7 views)
Reply With Quote
  #2  
Old 11-09-2018, 01:37 PM
ldoodle ldoodle is offline Windows 10 Office 2010 32bit
Novice
 
Join Date: Oct 2018
Posts: 17
ldoodle is on a distinguished road
Default

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!
Reply With Quote
  #3  
Old 11-11-2018, 01:29 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,616
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

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
[MS MVP - Word]
Reply With Quote
  #4  
Old 11-15-2018, 07:57 AM
ldoodle ldoodle is offline Windows 10 Office 2010 32bit
Novice
 
Join Date: Oct 2018
Posts: 17
ldoodle is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 11-15-2018, 02:10 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,616
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

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
and would be run on the mailmerge output document.

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
[MS MVP - Word]
Reply With Quote
  #6  
Old 11-16-2018, 04:38 AM
ldoodle ldoodle is offline Windows 10 Office 2010 32bit
Novice
 
Join Date: Oct 2018
Posts: 17
ldoodle is on a distinguished road
Default

Thanks for your help!
Reply With Quote
Reply

Thread Tools
Display Modes


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


All times are GMT -7. The time now is 04:57 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft