PixelsPerInch Property Example

This example sets the pixel density depending on the target screen size of the browser. For 800x600 pixel screens, the density is 72 pixels per inch. For 1024x768 pixel screens, the density is 96 pixels per inch. For all other cases, use a density of 120 pixels per inch.

With Application.DefaultWebOptions
    Select Case .ScreenSize
        Case msoScreenSize800x600
            .PixelsPerInch = 72
        Case msoScreenSize1024x768
            .PixelsPerInch = 96
        Case Else
            .PixelsPerInch = 120
    End Select
End With