设置PowerPoint保存图片的分辨率 (運行以下bat)

mode con cols=50 lines=23
@echo --------------------------------------------
@echo. 
@echo              PPT_DPI设置工具 
@echo.        
@echo    功能: 设置PowerPoint保存图片的分辨率    
@echo.
@echo --------------------------------------------

@reg query "HKEY_CLASSES_ROOT\PowerPoint.Application\CurVer" > temp_setdpi.txt
@echo off
 
type temp_setdpi.txt | find "PowerPoint.Application.11" > NUL && goto office2003
type temp_setdpi.txt | find "PowerPoint.Application.12" > NUL && goto office2007
type temp_setdpi.txt | find "PowerPoint.Application.14" > NUL && goto office2010
type temp_setdpi.txt | find "PowerPoint.Application.15" > NUL && goto office2013
type temp_setdpi.txt | find "PowerPoint.Application.16" > NUL && goto office2016

goto office_null
 
:office2003
@echo     检测到您的PowerPoint版本为2003
set version=11
goto office_old

:office2007
@echo     检测到您的PowerPoint版本为2007
set version=12
goto office_old

:office2010
@echo     检测到您的PowerPoint版本为2010
set version=14
goto office_old

:office2013
@echo     检测到您的PowerPoint版本为2013
set version=15
goto office_old

:office2016
@echo     检测到您的PowerPoint版本为2016或2019
set version=16
goto office_new

:office_null
@echo    抱歉,您未安装PowerPoint,或版本不支持
goto ending

:office_old
set dpiMAX=307
goto setDPI

:office_new
set dpiMAX=1000
goto setDPI

:setDPI
@echo     可以进行输出图像分辨率设置
@echo --------------------------------------------
@del temp_setdpi.txt
@echo.
@echo 请输入您想要设置的DPI值 (直接回车设为300)
@echo 取值范围[50~%dpiMAX%]
: inputDPI
@set /p DPI=

@if "%DPI%"=="" @set DPI=300

@echo %DPI%|findstr "[^0-9]" >nul&&(
    echo 输入有误,请输入纯数字
    goto inputDPI)

@if %DPI% GEQ %dpiMAX% @set DPI=%dpiMAX% 
@if %DPI% LEQ 50 @set DPI=50

@echo.
@echo 正在设置DPI为: %DPI% 

reg add HKCU\Software\Microsoft\Office\%version%.0\PowerPoint\Options /v "ExportBitmapResolution" /t "REG_DWORD" /d %DPI% /f

:ending
@echo.
@echo --------------------------------------------
@echo 按任意键退出 & pause>nul 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值