100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > 使用powershell将Ppt转化为PDF

使用powershell将Ppt转化为PDF

时间:2024-05-15 11:33:37

相关推荐

使用powershell将Ppt转化为PDF

直接上代码

#UPDATE DATA IN Ppt FILES 更新Excel文件中的数据#THEN CREATE PDF FILE Then 建立PDF文档[string]$path = "D:\powershell\ppts\" #Path to Ppt spreadsheets to save to PDF 保存到pdf的excel电子表格路径[string]$savepath = "D:\powershell\pdfs\"[string]$dToday = Get-Date -Format "yyyyMMdd"# $ppFixedFormat = "Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType" -as [type] # Get-ChildItem 在一个或多个指定位置获取项目和子项目$PptFiles = Get-ChildItem -Path $path -include *.pptx, *.ppt, *.pps -recurse # Create the Excel application object 创建Ppt应用程序队象# New-Object 创建Microsoft .NET Framework或COM对象的实例$objPpt = New-Object -ComObject Powerpoint.application# $objPpt.visible = $false #Do not open individual windows 不打开单个窗口foreach($wb in $PptFiles) {# Path to new PDF with date 带有日期的新的PDF的路径#Join-Path 将路径和子路径合并为一条路径。$filepath = Join-Path -Path $savepath -ChildPath ($wb.BaseName + "_" + $dtoday + ".pdf") # Open workbook - 3 refreshes links 打开工作簿 3秒刷新$presentation = $objPpt.presentations.open($wb.fullname,3)# Give delay to save 延迟保存Start-Sleep -s 5# 保存$presentation.Saved = $true "saving $filepath" #Export as PDF 导出为PDF# $ppFixedFormat::ppFixedFormatTypePDF#PPT 转pdf格式固定值 32# Word 转pdf格式固定值 17 $presentation.SaveAs($filepath,32)$presentation.close() } $objPpt.Quit()

ppt转不同格式的固定值

word 转不同格式的 固定值
Excel 转不同格式的 固定值

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。