View Single Post
 
Old 09-06-2017, 03:22 PM
macropodjr macropodjr is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Sep 2017
Location: Southern California
Posts: 3
macropodjr is on a distinguished road
Default Complex VBA Code to Resize Alternating Images at the End of a Mail Merge

Hello!

I have been working on this project for work for a couple weeks now and cannot figure out how to write the macro according to the needs of the project. I am using mail merge to create a three different letters with the use of many If-Then-Else statements. There are links to two different images within each letter. The first image is a header that is formatted as the correct size. The second image is stretched to the wrong size and, when the image is toggled, the image is no longer stretched but it is still not the right size.

I have tried placing the image merge field in a text box that was the correct size but the image did not fit the box. I have tried to program a macro to resize the selected images but am unable to select every other image in the document. There are nearly 1,000 letters and if I am unable to figure this out I will have to resize every image manually.

I have searched far and wide for the answer but have come up empty handed. One thought I had was to program a macro that would resize every other image in a document to a certain height or width, while keeping the aspect ratio. If someone could help me write a macro for this that would be tremendous!!

I have attached an image of the mail merge document I am working with, the document it produces, and the ideal look of the document for clarity. The first name of the student has been blacked out for privacy purposes.

Sincerely,
macropodjr
Attached Images
File Type: png image1.png (101.9 KB, 22 views)
File Type: png image2.png (144.2 KB, 22 views)
File Type: png image3-2.png (153.2 KB, 21 views)
Reply With Quote