Automatically adjust image size in word documents with macros

The easiest way to print two photos on a computer at ordinary times is to copy and paste the photos into a word document and then print the document out using a printer. However, when you come across some photos of different sizes, it becomes very troublesome to resize them in a word document. We can use macros to automatically resize photos so that they can fit under an A4 sheet.

Create a new Word document, switch the tab to "Layout", click on the location of the fluorescent yellow in the figure to open the page settings.

P01

In the Page Setup, set both the upper and lower margins of the settings page to 0.5 cm and the paper orientation to landscape.

P02

Select the Insert option in the Word tab, select the photo file to insert, and select one-time insertion.

P03

P04

At this time, switch to the tab to the view, click on the "macro" on the right.

P05

In the popup interface, enter a macro name, such as "Print", and click Create.

P06

Copy the following into the pop-up Microsoft Visual Basic, notice the values ​​in Height = 216 * 0.7 and Width = 300 * 0.8. If subsequent executions cannot be indented under the same page, you can adjust the number in this section.

Dim i As Integer

For i = 1 To ActiveDocument.InlineShapes.Count

With ActiveDocument.InlineShapes(i)

.Height = 238 * 0.7

.Width = 315 * 0.8

.Borders(wdBorderTop).LineStyle = wdLineStyleSingle

.Borders(wdBorderTop).LineWidth = wdLineWidth050pt

.Borders(wdBorderTop).Color = wdColorAutomatic

End With

Next i

P07

Closed after editing, back to the Word interface, click the "macro" drop-down menu (inverted triangle), find the "View macro" and click Run, Word will automatically zoom order, multiple pictures can easily be indented to one Page. If not, remember to adjust the Height and Width values ​​in the macro.

P08

P09

Press Ctrl + P to call up the print page, select print, an A4 size paper can indent multiple images, is not it convenient? With macro commands, you can turn many methods that require manual step-by-step adjustments into one step. It is more convenient to print photos later.

P10

Engine Overhaul

Engine Overhaul,Black Spacer Bush,Ferrous Metal Bushing,Ferrous Metal Spacer

Jinan Guohua Green Power Equipment Co.,Ltd. , https://www.guohuagenerator.com

This entry was posted in on