Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2023, 12:27 PM
hank1234 hank1234 is offline Issue with logo proportions after insertion in header Windows 11 Issue with logo proportions after insertion in header Office 2016
Novice
Issue with logo proportions after insertion in header
 
Join Date: Sep 2020
Posts: 11
hank1234 is on a distinguished road
Default

Thank you for your feedback on the issue.



Firstly, to clarify, the provided testfile1.doc and testfile2.docx do have empty headers where the logos should be inserted. If you save the logos in the C:\Test folder and execute the code on the test documents, you'll be able to replicate the issue I mentioned.

I appreciate your point on setting the height and width explicitly, and I've tried this approach. However, the issue persists specifically with .doc files and .docx files in compatibility mode. Locking the aspect ratio was one of the methods I attempted to maintain the proportions, but it didn't rectify the problem.

Regarding the image formats, I understand the merits of SVGs and PNGs over JPEGs for scaling. But the main concern here isn't about the quality of the scaled image; rather, it's about the proportions of the logos being distorted exclusively in the .doc files and .docx files running in compatibility mode.

If you could help address this specific problem or point me towards any workarounds, it would be greatly appreciated.
Reply With Quote
  #2  
Old 10-23-2023, 02:00 AM
Italophile Italophile is offline Issue with logo proportions after insertion in header Windows 11 Issue with logo proportions after insertion in header Office 2021
Expert
 
Join Date: Mar 2022
Posts: 554
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

Quote:
Originally Posted by hank1234 View Post
Thank you for your feedback on the issue.

Firstly, to clarify, the provided testfile1.doc and testfile2.docx do have empty headers where the logos should be inserted. If you save the logos in the C:\Test folder and execute the code on the test documents, you'll be able to replicate the issue I mentioned.

I appreciate your point on setting the height and width explicitly, and I've tried this approach. However, the issue persists specifically with .doc files and .docx files in compatibility mode. Locking the aspect ratio was one of the methods I attempted to maintain the proportions, but it didn't rectify the problem.

Regarding the image formats, I understand the merits of SVGs and PNGs over JPEGs for scaling. But the main concern here isn't about the quality of the scaled image; rather, it's about the proportions of the logos being distorted exclusively in the .doc files and .docx files running in compatibility mode.

If you could help address this specific problem or point me towards any workarounds, it would be greatly appreciated.
When you did your troubleshooting, did you bother to check the height of the "stretched" image? If you had you would see that it is still at the original height.

As I said to you originally you should set the images to the correct height before you insert them. That way you will have less code and no potential for problems.

The following code works perfectly in Compatibility Mode:
Code:
                    ' Check if the current header is for the first page or subsequent pages
                    If oHead.index = wdHeaderFooterFirstPage Then
                        Set oShape = .InlineShapes.AddPicture(filename:=strLogoFrontpage)
                        With oShape
                            .LockAspectRatio = msoTrue
                            .Width = CentimetersToPoints(3.94)
                            .Height = CentimetersToPoints(3.94)
                            .AlternativeText = "frontpage"
                        End With
                    ElseIf oHead.index = wdHeaderFooterPrimary Then
                        Set oShape = .InlineShapes.AddPicture(filename:=strLogoSubsequentPages)
                        With oShape
                            .LockAspectRatio = msoTrue
                            .Width = CentimetersToPoints(0.73)
                            .Height = CentimetersToPoints(0.73)
                            .AlternativeText = "subsequent page"
                        End With
                    End If
Attached Images
File Type: png Screenshot 2023-10-23 095858.png (9.0 KB, 15 views)
File Type: png Screenshot 2023-10-23 095918.png (9.4 KB, 15 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
header format issue mfitness92 Word 3 07-31-2022 01:03 AM
VBA Insert Image(logo) into header for multiple Word Docs Axis Word VBA 4 02-09-2022 10:34 PM
Issue with logo proportions after insertion in header Change Logo in Header in many Word-Documents ika Word VBA 15 10-20-2016 11:08 PM
Issue with logo proportions after insertion in header Macro to Insert Logo in header on 1st page only and bookmark it. youseeme Word VBA 9 09-16-2016 05:25 AM
Issue with logo proportions after insertion in header How to print header logo only in 1st page Shafraz Khahir Word 1 11-29-2010 11:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft