How to see size (resolution) of images in Word 2010 doc?

I have a Word 2010 doc with images from various sources.

Some images are low resolution and need to be replaced.

Once an image is in the doc, is there a quick way to determine its resolution?

Something like properties?

I can only find formatting and positioning commands.

Thanks, this is new territory for me.

Answer
Answer

Hi Carolina,

The following macro "PixelsMatter" will look at each picture in a document and determine its PPI resolution. A PPI of less than 150 is considered low resolution for printing. PPI between 150 and 200 would be considered marginal and it's a personal judgement call on how satisfactory it might appear.

The "sweet spot" is between 200 and 240 PPI, with anything above that is really not improving the print quality. With that said, of course if you are using some really large paper size (Word's maximum is 22 inches) and you want your image to fill that 22" space then you need to insert really big ~20 MB images.

The macro inserts Comments into the document on images that it finds where the PPI is Low, Marginal, or Higher than might be needed.

Hope this helps

Sub PixelsMatter()
    'Created by Richard V. Michaels
    'http://www.greatcirclelearning.com
    'Creating custom and off-the-shelf productivity apps for Office
    
    On Error GoTo ErrHandler
  
    Dim doc As Word.Document, rng As Word.Range, iRng As Word.Range
    Dim shp As Word.Shape, iShp As Word.InlineShape
    Dim PixelCount As Integer, FullWidth As Integer, PPI As Integer
    Dim Mac As Boolean
    
    Set doc = Word.ActiveDocument
    Set rng = Word.Selection.Range
    'Check only the range selected, else check entire body of the document
    If rng.Start = rng.End Then Set rng = doc.Content
    
    #If Win32 Or Win64 Then
        'this is a PC
        PixelCount = 96
    #Else
        'this is a Mac
        PixelCount = 72
        Mac = True
    #End If
    
    For Each iShp In rng.InlineShapes
        'only looking for embedded or linked pictures
        If iShp.Type = wdInlineShapeLinkedPicture Or iShp.Type = wdInlineShapePicture Then
            'determining original width before scaling
            FullWidth = iShp.Width / (iShp.ScaleWidth / 100)
            'calculate PPI density based on the current scaled size of inserted image
            PPI = FullWidth / (iShp.Width / PixelCount)
            Select Case PPI
                Case Is < 150
                    iShp.Range.Comments.Add iShp.Range, "PPI is " & PPI & " and will result in poor print quality. " & _
                            "We suggest either reducing the size of the picture in the document or replacing with a higher quality source image."
                Case Is < 200
                    iShp.Range.Comments.Add iShp.Range, "PPI is " & PPI & ", which is marginal for a good print quality. " & _
                            "We suggest you print a sample and check if the print quality is satisfactory for your needs. " & _
                            "Higher print quality can be achieved by either reducing picture size or replacing with a higher quality source image."
                Case Is < 240
                    'PPI density is optimal, no comment made
                Case Else
                    iShp.Range.Comments.Add iShp.Range, "PPI is " & PPI & " and does not contribute to better print quality... " & _
                            "it is only creating a larger than necessary file size for this document. We suggest replacing the image with a more appropriately sized source image."
            End Select
        End If
    Next
    
    If Mac Then GoTo ErrHandler
    'With a Mac running Office 2011 there is no need to go further
    'The excessively buggy Office 2011 VBA errantly places all "floating" shapes into the inline shapes collection
    'No other PC version of Office VBA does this and if the following code is executed on a Mac, double comments
    'would be placed on all floating shapes that met the PPI criteria specified in the following Select Case command.
    
    If doc.Shapes.count = 0 Then GoTo ErrHandler
    Dim wrapType As Integer, i As Integer
    
    For i = doc.Shapes.count To 1 Step -1
        Set shp = doc.Shapes(i)
        If shp.Type = Office.MsoShapeType.msoPicture Or _
            shp.Type = Office.MsoShapeType.msoLinkedPicture Then
            If shp.WrapFormat.Type <> Word.WdWrapType.wdWrapNone Then
                wrapType = shp.WrapFormat.Type
                Set iShp = shp.ConvertToInlineShape
                If iShp.Range.InRange(rng) Then
                    'determining original width before scaling
                    FullWidth = iShp.Width / (iShp.ScaleWidth / 100)
                    'calculate PPI density based on the current scaled size of inserted image
                    PPI = FullWidth / (iShp.Width / PixelCount)
                    Select Case PPI
                        Case Is < 150
                            iShp.Range.Comments.Add iShp.Range, "PPI is " & PPI & " and will result in poor print quality. " & _
                                    "We suggest either reducing the size of the picture in the document or replacing with a higher quality source image."
                        Case Is < 200
                            iShp.Range.Comments.Add iShp.Range, "PPI is " & PPI & ", which is marginal for a good print quality. " & _
                                    "We suggest you print a sample and check if the print quality is satisfactory for your needs. " & _
                                    "Higher print quality can be achieved by either reducing picture size or replacing with a higher quality source image."
                        Case Is < 240
                            'PPI density is optimal, no comment made
                        Case Else
                            iShp.Range.Comments.Add iShp.Range, "PPI is " & PPI & " and does not contribute to better print quality... " & _
                                    "it is only creating a larger than necessary file size for this document. We suggest replacing the image with a more appropriately sized source image."
                    End Select
                   iShp.ConvertToShape
                   shp.WrapFormat.Type = wrapType
                Else
                    iShp.ConvertToShape
                    shp.WrapFormat.Type = wrapType
                End If
            End If
        End If
    Next
    
ErrHandler:
    Select Case Err
        Case 0
            MsgBox "Action Complete", vbInformation, "Pixels Matter"
        Case Else
            MsgBox Err.Number & vbCr & Err.Description, vbExclamation, "Pixels Matter"
            Err.Clear
    End Select

End Sub

________________________________
Richard V. Michaels
info@greatcirclelearning.com
Provides productivity add-ins for Learning & Education professionals.
Site: greatcirclelearning.com

9 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated November 18, 2024 Views 21,358 Applies to: