如何禁用PowerPoint 2016图片自动调整功能?解决VBScript粘贴失真问题
Hi Yash, sorry to hear your QlikView-to-PowerPoint image workflow broke after upgrading to Office 2016—this automatic image resizing behavior is a common gotcha with newer PowerPoint versions. Here’s how to disable it in your VBScript to get crisp, correctly sized images again:
1. Disable Automatic Image Scaling in Your Script
The root issue is PowerPoint 2016’s default setting to auto-scale inserted images to fit the slide dimensions. Override this by setting the PictureInsertionBehavior property before you paste or insert the image:
' Assuming you already have a reference to your PowerPoint application object pptApp.Options.PictureInsertionBehavior = ppInsertPictureAsOriginalSize
The ppInsertPictureAsOriginalSize constant has a value of 2—if you get an error referencing the constant directly, you can use the numeric value instead.
2. Lock Aspect Ratio & Adjust Dimensions Properly
After pasting the image, make sure to lock its aspect ratio to prevent distortion, and base any resizing on the original image dimensions (not the auto-scaled version):
' Paste the image from clipboard Set pptSlide = pptPresentation.Slides(YourSlideNumber) pptSlide.Shapes.Paste Set pastedImage = pptSlide.Shapes(pptSlide.Shapes.Count) ' Lock aspect ratio to avoid stretching pastedImage.LockAspectRatio = msoTrue ' msoTrue = -1, can use numeric value if needed ' Optional: Resize based on original dimensions (example: 90% of original size) originalWidth = pastedImage.Width originalHeight = pastedImage.Height pastedImage.Width = originalWidth * 0.9 pastedImage.Height = originalHeight * 0.9
3. Verify No Hidden Auto-Adjust Settings
If you still see distortion, double-check that your script isn’t accidentally triggering any other auto-adjust features. Avoid using ShapeRange.ScaleHeight or ScaleWidth with relative scaling unless you’re sure the base size is the original image size.
Manual Setting (For Reference)
If you ever need to disable this behavior for manual use, go to:
- File > Options > Advanced
- Scroll to the Image Size and Quality section
- Check the box for Insert pictures at their original size
This matches what the script does with PictureInsertionBehavior, but the script method is critical for your automated workflow.
内容的提问来源于stack exchange,提问作者Yash_792

