|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Add pictures in specific parts of the document and resize them automatically - MS Word 2013
Hi all,
I'm new here and this is my very first time posting in this forum I've been trying to do something with a document that sounds simple but I don't know how to make everything that I'm expecting work at the same time. I have some sort of standard type of report in the company that I work, and need to add pictures to it. So what I want to do is to add 3 boxes in a certain page where I can insert the picture in a predefined frame and fixed height (the width can change, depending on the image's aspect ratio), and also maintain its position on the page. I have tried using a one-cell table for each image, with fixed dimensions and predefined the frame, and when I did that, the image wouldn't fit perfectly within the cell. I also have tried to add a Picture Content Control for each image (so I could click the icon and add the picture that I want), which I had a really hard time to put in a position that I wanted (dragging the content control didn't work, looks like the icon "Picture" above the box can't be moved), setting the frame and the height, but when I add the picture, I have to manually change the dimensions again and after I do that, the image goes to a different position. Any ideas regarding this issue? Thanks in advance! |
#2
|
||||
|
||||
The table approach is probably the way to go but, in your case, don't fix the width - start of with a narrow width and allow to table to auto-fit the width to fit the contents.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Quote:
I already tried the table approach, and this is what I did: I fixed the height, and I unchecked the box "Preferred Width" in the "Column" tab. But every time I uncheck it and open the table properties again, the box is checked. When I insert the picture, two things can happen (all the pictures must have a 9cm height): 1- If the initial cell's width is greater than the image's width (with the defined height), the image is added with the desired height, but the table won't fit the width, so there will be blank space within the cell; 2- If the initial cell's width is smaller than the image's width, the image size will be reduced to fit the cell's width, also reducing its height, but the cell's height will stay as 9cm. And I did it with the "Automatically resize to fit contents" box unchecked, when it is checked, it goes terribly wrong. Is it possible to make it fit perfectly within the cell? Even though the image's aspect ratio is variable? |
#4
|
||||
|
||||
Hmm, OK, it seems you need to fix both the height an width - the latter being large enough to fit any image that's 9cm high. If having blank space to the side of the image is a problem, that could be cured with a macro.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Thanks macropod!
I like the idea, although I just need to know how to record a macro on MS Word, because is not like Excel. I've tried once, but when I start recording I can't click anything on the document. How can I work around that? |
#6
|
||||
|
||||
The macro recorder won't provide what you need. The required macro might look like:
Code:
Sub Demo() Application.ScreenUpdating = False Dim i As Long With ActiveDocument For i = 1 To .InlineShapes.Count With .InlineShapes(i) If .Range.Information(wdWithInTable) = True Then .Range.Cells(1).Width = .Width End If End With Next End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Ok, I'll give it a try and I'll post here what happens. Thanks!
EDIT: It worked perfectly! You can mark this as solved. Thanks! |
Tags |
picture box, resize, word2013 |
|
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 |
Word 2013, changes in word document automatically apply to another word document | roosje | Word | 1 | 07-09-2014 12:13 PM |
Resize multiple pictures in a Word 2010 table | JBA479 | Word VBA | 1 | 01-24-2014 08:51 PM |
Resize and distribute width - 2 pictures | AndyDDUK | PowerPoint | 2 | 10-10-2012 03:38 AM |
Resize Email pictures in Outlook - Office 2007? | jonesnewton | Outlook | 0 | 05-16-2010 04:11 AM |