Modify Picture Compression Resolution Settings in PowerPoint 2007 (PowerShell)

Introduction

This PowerShell script demo illustrates how to modify picture compression resolution settings in PowerPoint 2007.

Scenarios

This question is asked by users in the TechNet forum. They just want to pre-configure picture compression in PowerPoint 2007.

Script

Step 1: Click Start, type powershell in the search box on the Start Menu, right-click the Windows PowerShell icon, and then click Run Windows PowerShell as administrator. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue
Step 2: Run the script in Windows PowerShell Console, type the one command: Import-Module <Script Path> at the command prompt.
For example, Type Import-Module E:\PS\ModifyPictureCompressionResolutionSetting.psm1  This is shown in the following figure.
Step 3: We can type the command Get-Help Set-OSCPictureCompression to display the entire help file for this function, such as the syntax, parameters, or examples.
 
Step 4: The script has three parameters:
You must specify a parameter with the command. For example, type Set-OSCPictureCompression -PPI150 command as shown below:
Here are some code snippets for your references. To get the complete script sample, please click the download button at the beginning of this page.
 
PowerShell
Edit|Remove
if($PPI220) 
        { 
            if($PSCmdlet.ShouldProcess("$KeyPath")) 
            { 
                $PSCmdlet.WriteVerbose($CultureMessage.Msg220) 
                Set-ItemProperty -Path $KeyPath -Name CompressDPISetting -Value 0 
                Write-Host $CultureMessage.SettingSuccessed 
                Get-RegPropertyValue $KeyPath 
            } 
        } 
        if($PPI150) 
        { 
            if($PSCmdlet.ShouldProcess("$KeyPath")) 
            { 
                $PSCmdlet.WriteVerbose($CultureMessage.Msg150) 
                Set-ItemProperty -Path $KeyPath -Name CompressDPISetting -Value 1 
                Write-Host $CultureMessage.SettingSuccessed 
                Get-RegPropertyValue $KeyPath 
            } 
        } 
        if($PPI96) 
        { 
            if($PSCmdlet.ShouldProcess("$KeyPath")) 
            { 
                $PSCmdlet.WriteVerbose($CultureMessage.Msg96) 
                Set-ItemProperty -Path $KeyPath -Name CompressDPISetting -Value 2 
                Write-Host $CultureMessage.SettingSuccessed 
                Get-RegPropertyValue $KeyPath 
            } 
        }

Prerequisite

Windows PowerShell 2.0

Additional Resources
Set-ItemProperty
Related forum threads:
http://social.technet.microsoft.com/Forums/en-US/officeappcompat/thread/359e52a2-a641-490f-8f49-6efdd604a079
http://social.technet.microsoft.com/Forums/en-US/officeitpro/thread/a3db722c-53e2-4473-8782-b80c586447d1/